Using Alternative Translations

To use alternative translations for the same string, you must make sure that the VPME Multilingual string translation engine is passed the Use ID that will return the translation needed for a particular context.

How do you pass a Use ID to the string translation engine? Well, it depends on the type of string involved, as follows:

·       Property Values: If the string being passed is the property value of an object, you simply set the object’s i_cUse_ID property (case-insensitive) to the Use Id that will select the correct String Translations record. In the case of our form example described above, you would set the form’s  i_cUse_ID property to “S” to get the alternative Spanish translation stored in the String Translations record with a String ID of “Employees” and a Use ID of “S”.

When a VPME Multilingual application translates a property value for an object, the value of the object’s i_cUse_ID property is automatically passed to the string translation engine as the Use ID. The first 50 characters of the property value, of course, is passed as the String ID.

Tip: If you set the i_cUse_ID property of an object to a value, the String and String Translations records for all the properties of the object that need to be translated must contain the same Use ID.

·       Constant, Report and Menu Strings: When a compile-time constant, report/label label, menu prompt or menu message needs to be translated, a call is made to the TranStr.prg program that passes the Use ID explicitly. The form of the call is:

TranStr(“String”,”UseID”)

   By default, VPME passes the following Use ID’s in the calls it makes to the TranStr program for the string types shown below:

 

String Type

Use ID

Constant

C

Report/label Label

R

Menu Prompt or Message

M

F3 Field Help Text

F3

  

·       Constant: In the case of constants, the “C” Use Id is arbitrary and is used as a convenience to you since it is likely that constant strings will require an alternative translation. When you insert your own call to TranStr for a constant, you can use whatever Use ID you like.

·       Report: In the case of report/label labels, the “R” Use Id is used as a convenience to you since it is likely that report/label labels will require an alternative translation. When you insert your own call to TranStr for a report/label label, you can use whatever Use ID you like.

·       Menu: In the case of menu prompts and messages, the “M” Use Id is used as a convenience to you since it is likely that menu strings will require an alternative translation to handle hot key characters. Since you cannot access the calls to TranStr for menu prompts and messages, our automatic insertion of the “M” Use ID in the call makes it possible for you to set up alternative translations for menu strings.

Tip: To avoid confusion, we recommend that you do not use the Use ID values (C, R, M, F3) that VPME uses when you create your own Use ID’s.

More:

How to Localize Fonts