How Do I Define a Translation File? (Magic xpa 4.x)
A translation file contains a list of phrases that are found in your application, and their translations.
The first thing you need to do is to create a list of the text strings that need to be translated. This file will include all of the strings in the native language, which in the example shown here is in English.
You can create the file manually, by just typing in the strings you need to translate. Note that the strings should be as-is, with decoration text, so for example '&File' should be '&File' and not 'File'.
Or, you can use the String Extractor utility that comes with Magic xpa. This will create an XML file containing each of the strings, as well as the context and whether it is part of an expression. The source code for the utility is included, so you can customize this to create a place for your translators to edit text and output the translation list.
Next, insert one line under each of the native language lines, which is the translation into the second language. In this example, there is a Spanish translation of each of the English strings.
Performing this step requires the services of someone who is familiar with both languages.
Also, you will want to use Unicode for the text file, so you can handle special characters required in some languages.
When you are creating a translation string for a choice control, you need to translate the entire string at once. The number of items in the two strings must match.
Once you have your translation list set up, you can create your Magic xpa language file. You do this by running the MLS_BLD command.
The syntax of the MLS_BLD command is:
MLS_BLD <source> <destination> <code page>
where:
source – the path and name of the translation file
destination – the path and name of the Magic xpa language file (created by MLS_BLD)
code page – an optional code page to be used; if omitted, the default code page will be used
You can run this from the command line, create a .bat file, or create a Magic xpa program to run the program.
That is all there is to it. Once the MLS_BLD command finishes, your translation file is ready to use, as shown in How Do I Translate My Application to Another Language?.