Strings and String Translations

Before we go further, let’s take a closer look at how strings and string translations are handled in a VPME Multilingual application.

Strings

As you build an application, you enter strings for form and control properties, menu prompts and report labels. You enter those strings in your application’s Master Language. With VPME Multilingual, you must create a string record for each application string in the application’s Strings table (SVPMStrings.dbf). Fortunately for you, VPME Multilingual provides tools that automate the creation of string records, as you will see in the following sections of this chapter.

String Translations

When you add strings to an application’s Strings table, you must also add translations of the strings to the String Translations table, SVPMStringTranslations.dbf, for the languages in the application. You use the String Translations form reached from your application’s Admin menu to add string translations.

Starter String Translations

VPME creates an application’s starter String Translations table from SVPMStringTranslations.dbf, the New Project String Translations Template table in VPME’s \NEW PROJECT directory. String translations from the New Project String Translations Template table are included for each language you select that has translations in that template table.

Displaying String Translations

When an application needs to display a translation for a string, it finds the translation in the String Translations table:

1.   Using the first 50 characters of the string to match the String ID field in the String Translations table records, and

2.   Using the “Use ID” value associated with the string to match the Use ID field in the String Translations table records.

·       If the string is a property value, the Use ID value is taken from the object’s I_cCUSEID property, which you enter.

·       If the string is a menu prompt, the Use ID is “M”.

·       If the string is a report label, the Use ID is “R”.

·       If the string is a compile-time constant the Use ID is “C”.

·       As you will learn as you read further, the Use ID is a handy feature. The Use ID allows you to specify different translations for the same string value. You will learn more about the Use ID and how to use it as you read the remaining sections of this chapter.

3.   Using the Language ID to link to the translation record for the language needed.

Tip: If a matching String Translations record cannot be found when a string needs to be translated, the string is displayed untranslated.

Now, let’s look at the details of how to create string and string translations records.

More:

How to Create String Records