LDE(X)6.4 - 'Rosemary'

Information for Translators

Localisation files

Currently there are no differences in the localisation implementation between 6.3 and 6.4. There are new strings and some have been relocated for various reasons, but there is no expectation that the implementation will change in the forseeable future. Localisation support for the WSH systems is the same as in LDE(X)6.3. The concept and implementation is similar to that in the rest of LDE(X), with translations being located under .js files within LDE(X)\Core\JSLib\locale\<language>

LDE(X) has support for multiple languages through the strings that are defined in the various languageresource.rc and <languagename>.rc files scattered throughout the system. This proliferation of files results from the modular nature of the system - Core has its own strings, the current interface has its own strings and all of the plugins also have individual strings. Whereever possible, string duplication is avoided in these files - common strings are defined within the Core file, with plugin and interface specific strings being defined at their respective level.

The implementation of these resource files is the same throughout :

languages

french.rc

german.rc

.....

languageresource.rc

languageresource.rc contains the full English list of strings and brings in the non-English strings from the relevant translation, located in the languages subfolder, based on the user's language preference. Any untranslated strings will appear in English. The simplest option is to copy all the strings (not the If...Else...EndIf block, but the rest of the file) into a new file (<languagename>.rc under the languages folder) and then translate them. If you are unsure of what strings mean, request advice from the forum or simply change the string and see where it changes in the host interface/plugin/etc.

To integrate a translation, we need to use numeric comparisons (LiteStep lacks string comparision for its variables) and the basic structure is shown below.

Core\includes\language-index.rc

If LDELANGUAGE
Else
LDELANGUAGE 0
ENGLISH "1"
EndIf

If LDELANGUAGE = 0
ENGLISH "1"
EndIf

If LDELANGUAGE = 1
FRENCH "1"
EndIf

If LDELANGUAGE = 2
GERMAN "1"
EndIf

If LDELANGUAGE = 3
SPANISH "1"
EndIf

If your language does not yet appear in this list, add a relevant block of code with the next highest number (e.g. if you were contributing an Italian translation, it should be assigned the value of 4 in the above example).

The next step is to write the code that will actually change the language following the user's request. This is actally very simply - just copy and paste one of the functions in the file below (an example is shown). Rename the name of this newly pasted function and change the number to match the one just assigned to your language, as is shown below for the case of an Italian translation.

Core\scripts\native\litestep\language-scripts.rc

*Script bang !useitalianlanguage
*Script exec !VarSet targetfile "$LDERootDataLocation$\user-ui.rc"
*Script exec !VarSet SCORE_THERAPY_SUPPRESS "false"
*Script exec !therapy_tracer "LDELANGUAGE" "4"
*Script ~bang

The final step is to allow your translation to be used in the interface & this is done by a small further code alteration. This requires a new file to be created with a single line of the form as in the example below :

UI\Ermintrude2\includes\languages\integrate\italian.rc

*Popup "Italian" !useitalianlanguage

NOTE: This is done at the interface level because not all interfaces will support the translation framework - this is the only change (apart from the translations themselves) that is made at the interface level. Everything else is handled within Core.

For a full translation, the Core, interface and plugins need to be translated as described. There is also the possibility to translate the First Run screen (used in Ermintrude 2.x) and the files for this are located in the Ermintrude developer package available from the OpenLDE page. You will need PhotoShop 7 to do this directly, but the alternative is to submit text translations to the development team and these will be used to provide translated forms of this user aid. Translations for this component are found in Ermintrude2\LDEImages\FirstRun\<languagename>.