Localizing Applications

From RAD Studio
Jump to: navigation, search

Go Up to Internationalization and Localization

Once your application is internationalized, you can create its localized versions for the different foreign markets in which you want to distribute it.

Ideally, during internationalization steps, resources in your application have been isolated into a resource DLL that contains form files (.dfm in VCL applications) and a resource file.

Localizing resources

  • Localizing functionality

Localization may include functionality customization. For example, a financial application may require modification for the tax laws in different countries.

  • Localizing UI design

Creating an application for several foreign markets, you should provide that your design of such UI features as texts, graphic images, data formats, sorting order, and other satisfies to some localization requirements important during translation.

  • Creating resource DLL projects for additional languages

You can use the Resource DLL Wizard to create resource DLL projects for additional languages. Each created resource DLL project contains the .dfm form file that stores forms and other GUI resources and the RC resource file containing resource strings declared in resourcestring sections. (See Creating Resource DLLs.)

The Resource DLL Wizard creates each resource DLL project in a separate subdirectory specific to the target locale. The first two characters indicate the target language, and the third character indicates the country of the locale (see Language Culture Names, Codes, and ISO Values). For example, for "German - Germany" locale the subdirectory will be DEU.

  • Translating resource strings in resource DLL projects

The next step is translation of resource strings in .dfm form files and RC resource files. In the Project Manager, double-click your .dfm form or RC resource file to open it in the Translation Editor and translate the relevant strings.

Translators, who do not have the installed RAD Studio IDE, can use the stand-alone External Translation Manager (instead of the IDE's internal Translation Editor) to translate resource strings in your resource DLL projects.

Note: In a resource DLL project, you cannot add or delete GUI components.

  • Build resource DLLs for translated languages

Run the Project > Build All Projects command to build all projects in the current project group. This command builds all resource DLLs for all resource DLL projects created by the Resource DLL Wizard for all additional languages. For example, if you have an application with the Test.exe executable file and the locale for the resource DLL project is "German - Germany", then RAD Studio IDE will build the Test.DEU resource DLL in the same root project group directory as the main Test.exe application executable file.

Deploying localized applications

In your localized project you have created a number of localized resource DLLs that must be distributed alongside your main application executable. For example, if your application has the Test.exe executable file and you have built the Test.DEU resource DLL for the "German - Germany" locale, then you should deploy the Test.exe executable file together with this localized Test.DEU resource DLL. (See Deploying Localized Applications for more details.)

How applications find localized resource DLLs

When you start up a localized application, it tries to find and load the localized resource DLL. To find the localized resource DLL, the application first obtains the preferred language name list. Using this list, the application (having the Test.exe executable file) attempts to find the localized resource DLL having one of the following extensions:

  1. Test.XYZ. If the " locale override" key having the XYZ value is defined for the Test.exe executable in the Windows registry.

    The "locale override" key can be added under the HKEY_CURRENT_USER\Software\Embarcadero\Locales or HKEY_LOCAL_MACHINE\Software\Embarcadero\Locales registry keys. The Name field of "locale override" key should be a string value identifying your application's path and the Test.exe executable filename. The Data value should be equal to the desired extension XYZ of your localized resource DLL.

  2. Test.AB-CD. Where AB represents the language code and CD represents the region code.
  3. Test.AB
  4. Test.EFG. Where EFG represents the three-letter language code. (See the ISO 639x Values in Language Culture Names, Codes, and ISO Values.)
  5. Test.EF

If the application finds the localized resource DLL file at one of these steps, the search stops and the application loads the found resource DLL.

For example, if the UILocale is set to German - Germany and the "locale override" key has the value XYZ, then running the Test.EXE application, Windows will search for the following files in the directory from which Test.EXE runs:



See Also