Ticket K18310
Visible to All Users

How to perform full localization of the ExpressScheduler?

created 15 years ago

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 cxDueTimeInfoToTextcxGetRecurrenceDescriptionString, and cxGetHolidayRecurrenceDescriptionString functions.
And finally, on the form's initialization you should set these functions to cxDueTimeInfoToTextProccxGetRecurrenceDescriptionStringProc, and cxGetHolidayRecurrenceDescriptionStringProc accordingly:

Delphi
initialization 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.

Show previous comments (1)
DevExpress Support Team 6 years ago

    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

        Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

        Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.