After you translate the strings in a .tra file, you can build an .mpr file for the other language, reconfigure your system for the other language, and then display the translated strings in your application.
To take the translated strings and add them to an .mpr file, change and evaluate the sample expression in the Building Translated MPR files window, which essentially provides:
AbtNlsTranslatedMprBuilder new buildNewBinaryMpr: '<new .mpr file>' fromExistingBinaryMpr: '<original .mpr file>' fromTraFilename: '<.tra file>'
For AddressApplication, where the German translation file is aaaddg10.tra and you want the new .mpr file to have the name aaaddg10.mpr, you evaluate:
AbtNlsTranslatedMprBuilder new buildNewBinaryMpr: 'aaaddg10.mpr' fromExistingBinaryMpr: 'aaadde10.mpr' fromTraFilename: 'aaaddg10.tra'
This code is useful for translating different parts of a .tra file at different times. For example, new messages may have been added after your first round of translations. Since the .tra creation process is really an overlay process, you can overlay (that is, translate) parts or all of a given .tra file. If you find it easier to manage your translation tasks by breaking up your .tra files then using this code will allow you to build the new translated .mpr without first manually gluing all of the .tra pieces back together. Here are the ground rules for doing this:
To get VisualAge to use a different .mpr file for your application, ensure that VisualAge can find the file in the path designated in abt.ini, then select NLS > Rebind Image Strings from the Tools menu of the Transcript.
So VisualAge can find the file, the sixth character of the .mpr file name must correspond with the language setting for VisualAge and for the country setting of your workstation. Setting language preferences lists the characters that VisualAge uses in the sixth character position to specify language settings. To change the language settings for VisualAge, you might need to add language=<language> and territory=<country> to the abt.ini file in the main VisualAge directory; and then restart VisualAge.
When you open the view in a VisualAge editor, the strings might still appear in the original language. To see the translated strings, open the view through an openWidget connection, or through a script like the following:
openAddressApplication AddressView new openWidget
Or, simply Execute the following code in the System Transcript window:
AddressView new openWidget.
Here's what AddressView looks like in German: