How to Localize Data Sources

Localizing a data source refers to using a different ControlSource property value for a control based on the language in which a VPME Multilingual application is running.

For example, let’s say you created an inventory control application that needed to display and edit product descriptions in four different languages (Dutch, English, German and Spanish). English is the application’s Master Language. The product descriptions are stored in a table named “Products”.

In your Products table, you created four fields to hold the product descriptions for each of the four languages. Let’s say the field names are DutchPD, EnglishPD, GermanPD and SpanishPD.

Now, to localize the product description when you display it on a form, you would do the following:

1.   When you create the form to display the product description, you would enter the table alias and Master Language product description field name (products.englishpd) in the ControlSource property of the control that will display the product description.

2.   Use the String Manager to create a Strings table record with “products.englishpd” (without the quotes) as the String ID. The String Manager will automatically create String Translations records for Dutch, German and Spanish.

3.   Use the String Translations form to enter translations for Dutch, German and Spanish. The translation you enter for each language would be “products.fieldname” where fieldname is the name of the product description field for a language in the products table. For example, you would enter the translation “products.dutchpd” for the dutch language.

When you run the form in Dutch, VPME Multilingual would find the Dutch String Translations record for the String ID “products.englishpd” and would use  “products.dutchpd” as the ControlSource for the control that displays the product description.

Tip: When you need to localize a data source, make sure that the ControlSource Property check box is checked in the Translate column on the Properties page of the Language Builder or Language Manager for each language that requires a localized data source.

Ř To localize (translate) a data source

1.   Create Data Fields: Create fields in the table that stores the data for each language, including the Master Language.

2.   Create Control: Create the control that will display the data with the control’s ControlSource set to the table alias and Master Language field name (alias.masterlanguagefieldname).

3.   String Manager: Open the String Manager from your application’s Admin menu.

4.   New: Click the New toolbar button. VPME adds a blank record.

5.   String ID: In the String ID text box, enter “alias.fieldname” (without the quotes) where alias is the alias of the table that holds the data and fieldname is the Master Language field in the table that holds the data.

6.   Use ID: If you are localizing data for an object that has a value in its i_cUse_ID property, enter that value in the Use ID text box.

7.   Comments: Enter any comments you may have about the field or its usage. Optional.

8.   Locations: If you like, enter the locations in your application where the field is used. Optional.

9.   Save: Click the Save toolbar button.

10. Repeat for Each Use ID: Repeat steps 2 to 9 to create a String record for each i_cUse_ID property value associated with a control that uses the same data source and needs its data source localized.

Normally, you won’t have different controls that use the same ControlSource, but if you do and if they have different i_cUse_ID property values, create a String record for each i_cUse_ID property value.

11. String Translations: After you have created all the String records you need for the data source and associated Use ID’s, select one of the String records you created on the String Manager form. Click the Translations button. VPME displays the String Translations form filtered to the String record displayed on the String Manager form. For each language for which you need to localize the data source, enter “alias.fieldname” (without the quotes) where alias is the alias of the table that holds the data and fieldname is the field in the table that holds the data for the language.

12. Repeat for Each String Record: Repeat step 11 for each String Record that you created in steps 2 to 9.

The String records you create are stored in the Strings table, and String Translations records are created in the Strings Translations table for each language in your application.

More:

How to Localize Pictures