Table of contents
- What is EMS Advanced Localizer?
- What do I need to start working with EMS Advanced Localizer?
- Is EMS Advanced Localizer able to localize the strings from the resourcestring-section out of the source code?
- I cannot find out, what I can do with TQUserLanguageSource. Could you give me a short explanation of the purpose of this component?
Q:
What is EMS Advanced Localizer?
A:
EMS Advanced Localizer is an indispensable component suite for Borland Delphi for adding multilingual support to your Delphi applications. Using the powerful component editors of this suite you can easily and quickly localize the properties of components within each form, generate a language template file containing the current values of language-specific component properties, manage localization files, and specify which components and properties are to be localized. Applications that use Advanced Localizer can switch languages with one command at run-time, without reloading. Also, this suite provides the ability to write component descendants that can work with user-defined language files.
Q:
Is EMS Advanced Localizer able to localize the strings from the resourcestring-section out of the source code?
A:
You can localize any string in the code by the following steps:
- Create a new section in your *.lng file and name it as you want, e.g. [Additional strings].
- Copy all strings from resourcestring section to that new section of *.lng file. For example, the resourcestring section:
resourcestring
String1 = 'String one';
String2 = 'String two';
in *.lng file would be
[Additional strings]
String1="String one"
String2="String two" - Now you can get any of that strings by the following code:
var
S1, S2: string;
...
{Source is TQLanguageSource component on your form}
Source.FormSection := 'Additional strings';
{ Getting value of String1 }
S1 := Source.LoadString('String1', '');
{ Getting value of String2 }
S2 := Source.LoadString('String2', '');
{ S1 and S2 are now localized. You can use them in any purposes}
Q:
I cannot find out, what I can do with TQUserLanguageSource. Could you give me a short explanation of the purpose of this component?
A:
The difference between TQUserLanguageSource and TQLanguageSource with TQDBLanguageSource is that TQLanguageSource and TQDBLanguageSource take localization strings from a fixed source (a text file of fixed format and a dataset), but TQUserLanguageSource can take localization strings from any source. It contains a number of additional events that allow working with a source. So if you want to place localization string to a source different from a text file of the supported format and a dataset, you need to use TQUserLanguageSource.





