Description:
I want to localize all parts and dialogs of the ExpressScheduler.
How can I do this?
Answer:
Most of ExpressScheduler parts can be localized via the Localizer Editor and TcxLocalizer component or via cxGetResourceString/cxSetResourceString procedures, as shown in following Knowledge Base Articles:
A326: A326
K18138: K18138
However, some parts and dialogs cannot be localized that way: Overdue strings (in Reminder) and Recurrence information (in the cxScheduler's event editor and holidays editor).
It is caused by the fact that these strings are generated dynamically based on several conditions.
To localize them, you should create your custom functions for generating these strings and register them.
These functions should be based on our cxDueTimeInfoToText, cxGetRecurrenceDescriptionString, and cxGetHolidayRecurrenceDescriptionString functions.
And finally, on the form's initialization you should set these functions to cxDueTimeInfoToTextProc, cxGetRecurrenceDescriptionStringProc, and cxGetHolidayRecurrenceDescriptionStringProc accordingly:
Delphiinitialization
cxDueTimeInfoToTextProc := cxMyDueTimeInfoToText;
cxGetRecurrenceDescriptionStringProc := cxMyGetRecurrenceDescriptionString;
cxGetHolidayRecurrenceDescriptionStringProc := cxMyGetHolidayRecurrenceDescriptionString;
In the attachment you'll find an example that demonstrates this approach in action.
AVAILABLE TRANSLATIONS
Below are listed all the translations that we have at the moment. If you have already translated these methods to a certain language, and wish to share these translations with others, you are welcome to contact us at Support@DevExpress.com. We will be glad to publish them here.
"Below are listed all the translations that we have at the moment."
Don't see it. Do you have Russian? While you have most of your support team Russian speaking -)
Hello,
Our VCL controls do not have ready to use localization resources. It is necessary to manually localize them. However, you can find different resources kindly provided by our customers in the current and in the K18138: How to localize VCL components Knowledge Base articles.
If you have your own localization resource that you can share with other our customers, you can attach in to a separate comment in the mentioned articles.
A note of warning: that German example changes the sentence structures and the code!
E.g. where the original English version says
Result := 'Occurs ' + Result + GetDateBounds(APattern) + GetTimeBounds(APattern) + '.'
the German version changes this to:
Result := 'Dieser Termin ' + Result + GetDateBounds(APattern) + GetTimeBounds(APattern) + '.'
Also where English strings read e.g.
'day %d of every %d months'
the German version makes this
'steht jeden %d. Monat am %d. an,'
and the verb forms of 'occur' have been moved into the string literals.
Also: it not only changes the sentence structure, but also replaces strings like
third day
with a numeral
3. Tag
This means you can use that German example 'as is' if you need German only, but if you need to extend it to more languages or another translation mechanism you have to be very careful - the English DevEx strings and code do not exactly match the German ones.
Here is another example of how this can be implemented.
It uses resourcestrings for all texts, so if you have a translation system based on resourcestrings you can use if for other languages.
Caveats:
With our translation code, the translation of the resourcestrings happened after execution of the Initialization section of all units.
Therefore we had to change the consts arrays into global var arrays and set everything up in procedure InitializeRecurrenceTranslation.
Different languages have different constructs, things like plurals and inflections make translations complex. Using phrases instead of complete sentences with verbs helps.
cxGetHolidayRecurrenceDescriptionStringProc is not implemented, we don't use it
This example contains Dutch and German translations. Our translation code uses Dutch as the original language.
Use at your own risk ;-) No support