Isolating Resources

From RAD Studio
Jump to: navigation, search

Go Up to Localizing Applications

The most obvious task in localizing an application is translating the strings that appear in the user interface. To create an application that can be translated without altering code everywhere, the strings in the user interface should be isolated into a separate resource module. Delphi automatically creates a .dfm form file that contains all the resources for your menus, dialogs, and bitmaps.

Also you need to place in a separate resource module all strings, used in your code, that you present to the user (such as error messages). To place such strings into a resource module, declare such strings as string constants in the Resource Strings sections. Such string resources are not included in the .dfm form file, but the compiler places them into the generated .drc resource file.

For more information about resource string constants, see the Delphi Language Guide. It is best to include all resource strings in a single, separate unit.

RAD Studio provides a suite of Translation Tools to facilitate the localization of Win32 applications for different locales. Translation Tools provide the Translation editor that supports the translation of string resources stored in .dfm form and .drc resource files. Translation Tools provide the Resource DLL Wizard to add new languages to your project and generate resource DLL projects to build resource DLLs for added languages.

For information on using resource DLLs for different languages to localize your applications see Using Resource DLLs.

See Also