[All]
ITE and ETM Tutorial for Delphi 2005
By: Technical Publications
Abstract: This tutorial describes how to use the localization tools included in Delphi 2005
This tutorial demonstrates how to use ITE and ETM to localize a simple Delphi project. The project contains one button on
the form, and one resource string to load when the button is clicked. Strings to be localized in this sample project: the
button's caption and the resource string.
Some technical terms:
|
Term
|
Description
|
|
ITE
|
Integrated Translation Environment
|
|
RDW
|
Resource DLL Wizard (for Win32 projects)
|
|
SAW
|
Satellite Assembly Wizard (for .Net projects)
|
|
TR
|
Translation Repository
|
|
ETM
|
External Translation Manager
|
In Delphi 2005, ITE and ETM only support Win32 VCL forms applications and .NET VCL forms applications. Windows Forms
application for .NET is not supported. RDW is used for Win32 projects and SAW for .NET VCL projects.
For the purpose of this tutorial, we will use a Delphi for Win32 project as an example.
Creates the base project:
- Start Delphi 2005
-
File | New | VCL forms application - Delphi for Win32
- Drop a standard control TButton from Tool Palette onto the form
- In Object Inspector, set the Caption of the button to Click Here
- Switch to Code View
- In var section, under Form1: TForm1; add the following to declare a resource string:
resourcestring greetings = 'Hello world';
- Go to Design View, double click on the button, and you are taken to Code View with a
Button1Click procedure added
- Add Button1.Caption := greetings; to the body of the procedure
- Save all.
- Create a new folder forTutorial under Borland Studio Projects
- Run the project to make sure it works.
- Click on the button, its caption changes to Hello world.
Create resource dll using Resource DLL Wizard (RDW)
-
File | New | Other | Delphi Projects | Resource DLL Wizard
- Click on the Next button
- You can see the project name, root directory, and base language
- You can change the base language using the pull-down list
- Change thisEnglish (United States), if not already selected
- Click on the Next button
- You can select from the list of all the available languages available for creating resource DLLs. Select two and
click on Next
- For this example, selectFrench (France) andGerman (Germany)
- The two languages are listed and their path can be edited
- For this example, leave them as is
- Click on Next button to go to the next page, where you can add additional files
- For this example, we will not be adding any additional files
- Click on Next, you will see the actions to be taken
- The Update Modes are "Create New" since you do not have an existing project to either update or
overwrite
- Click on Next, the wizard provides a final summary of the resource DLLs to be generated
- Click on Finish button
- You will see process information as follows
- Click on OK, and see a fresh Translation Editor
- Go to forTutorial folder where you saved the project and notice that FRA and DEU subfolders are created.
- Suppose you want to add or remove languages now, you can either do it by openingResource DLL Wizard again or
doing it from Project | Languages | Add/Remove.
Using ITE to do translation
- Double click on Unit1.dfm under Project1.FRA in Project Manager
- Locate Button1.Caption entry in the Translation Editor
- Its status is Untranslated. Change Button1 under French (France) to any French string you want.
We use French-Button1 as an example.
- Click on Save button on the Translation Editor, and notice Button1's status is changed to
Translated.
- Double click on Project1_DRC.rc under Project1.FRA in Project Manager
- Locate Unit1_greetings entry, and change it to French-hello world. Save and notice its status changes
to Translated
- Do the same to unit1.dfm and Project1_DRC.rc under Project1.DEU, with strings
"translated" to German Button1 and German-hello world.
-
Project | Compile all projects
-
Project | Languages | Set active
- The default language is English
- Change it to French, Run | Run, you will see the translated button caption: French Button1.
Click on it, French-hello world will be loaded.
- Similar thing will happen if you set the active language to German, except the corresponding German strings
will show
- Drop another button (or any other control) onto form
- For this example, we will use another TButton
-
Project | Languages | Update Localized Projects
- Click Yes, when you are asked to save and compile
- Check the .dfm's again, the information about the second control will be listed in Translation Editor for
you to update
Translation Repository
Translation Repository (*.tmx file) can let you store the translations. This allows you to reuse your translations
should the same resource strings appear in a future project.
- In Translation Editor, right click on Button1 entry, do Repository | Add strings to repository
- Go to IDE main menu, do View | Translation Manager | Translation Repository, You can see the translated
strings are listed under each language
Using ETM to do translation
- Assuming translation process is done by third-party vendor who does not have access to ITE, developer then need to
send zipped localized folder to translator
- Translator unzips the files and starts ETM
- In ETM, File | Open, open Project1.bdsproj under FRA
- Click on Workspace tab, Project1.bdsproj will be expanded
- The rest will be similar to what you would do with Translations Editor: do translations in the grid and save
the change.
- Right click on the translated string, and you have the option to either Add strings to the repository or
Get strings from the repository
- Click on the Translation Repository button in ETM and you can view the repository.
- Click on the Options button, you will see Translation Tools Options. And you can define the Repository
options on the Repository page
- Close ETM
- Send the zipped files under FRA and DEU folders back to the developer
Developer integrates the translated file and creates the localized project
- Developer gets the files and put them back under the forTutorial directory
- In Delphi 2005, open the project group
- In Project Manager, under ProjectGroup1 (or whatever the name you saved as), notice that
Project1.FRA and Project1.DEU are listed
- Right click on Project1.FRA, and Build
- With the base Project1.exe set active, do Project | language | Set active language, set it to
French
-
Run | Run
- The localized project with French translation is created
- Go to \\Borland Studio Projects\forTutorial, run Project1.exe to verify all French strings are loaded
- Same can be done to create the localized German project
** The basic process for localizing a VCL for .NET project is the same. Instead of Resource DLL Wizard, you will
use Satellite Assembly Wizard to generate localized satellite assemblies. On a non-US operation system, if you
have problem generating localized satellite assemblies, that is because the .NET SDK path is not included in your user
PATH. You need to add it (typically c:\Program files\Microsoft.NET\SDK\v1.1\Bin) into your user PATH environment
variable.
Connect with Us