Add Missing String Records

It wasn’t feasible to write a Create String Records routine that could find all the strings in a VPME application and add them to the Strings and String Translations table. Consequently, we gave a VPME Multilingual application the ability to create String records on the fly for strings it tries to translate that aren’t in the Strings table.

Tip: During the development of a VPME Multilingual application, you should use VPME’s ability to create String records for you. Then, use the “Create String Translations” utility of your application’s Language Manager to create String Translations records for the new String records.

Ř To have VPME create missing string records

1.   Run Application: While in VPME, run your application from the Run Application button on the Object Builder or the Run Application option on the VPME Tools – Test menu.

2.   Select Language: Select a language other than the application’s Master Language on the Language Selection form reached from the File menu. Any language will do.

Tip: For the Language Selection option on the File menu to be enabled, User Access Security must be on and the logged in user must have languages selected on the User Language form reached from the Admin – Security submenu of the application. See User Language Selection and Select User Language.

3.   Run Everything: Run all the menu prompts, reports, forms and anything else that displays strings that aren’t captured by the Create String Records utility described in the preceding section. As your VPME Multilingual app tries to translate the strings it finds, it will create String records for them.

4.   Create String Translations Records: After you have let VPME create missing string records for you, run the Create String Translations records utility on the Language Manager. See Creating Missing String Translations Records.

Tip: The ability of a VPME Multilingual application to add missing String records is only active when you run a VPME Multilingual app in the development mode, or from VPME. Therefore, be sure you are running your VPME Multilingual application from VPME when you want to add missing String records.

How to Select the Types of Strings to Add

You can choose the types of strings that a VPME Multilingual application will add to the Strings table. Open the Language Builder from the Tools menu in VPME. Select the Properties page. Under the “Add Missing Strings” column, you can choose the types of strings to add.

The following types of strings are included in the “Add Missing Strings” column:

·       Constant: Compile-time constants that have been set up to be translated using the TranStr(“LabelText”,”C”) expression. (See How to Localize Compile-Time Constants)

·       Report: Report and label labels that use the TranStr(“LabelText”,”R”) expression. (See How to Translate Report Labels) Report/lable labels are processed by the Language Builder’s Create String Records utility. However, if you manually add the TranStr(“LabelText”,”R”) expression to a report/label and don’t rerun the Create String Records utility, VPM’s “Add Missing Strings” functionality will create a String record if needed.

·       Menu: Menu prompts and messages that have been set up to be translated using the TranStr(“LabelText”,”M”) expression. (See How Menu Prompts and Messages Are Translated)

·       Caption: Caption property values.

·       ControlSource: ControlSource property values.

·       DownPicture: DownPicture property values.

·       DragIcon: DragIcon property values.

·       Font: Font property values.

·       Icon: Icon property values.

·       InputMask: InputMask property values.

·       Picture: Picture property values.

·       RecordSource: RecordSource property values.

·       RowSource: RowSource property values.

·       StatusBarText: StatusBarText property values.

·       ToolTipText: ToolTipText property values.

Default Selections

By default, the Constant, Report, Menu, Caption, StatusBarText and ToolTipText string types are selected for you on the Properties page of the Language Builder.

The string types not selected by default are string types that are not normally translated, and consequently, String records are not usually needed for every occurrence of them. For example, all ControlSource property values do not normally need to be translated in a multilingual application. Therefore, it doesn’t make sense to add all the ControlSource property values in an application to the Strings table. If a particular ControlSource property value needs to be translated, you can manually create a String record for just that property value.

Nevertheless, if your application needs to translate all the values for a string type not selected by default, you can always select that string type’s checkbox, and VPME will automatically create String records for all the property values of that string type that it encounters.

Technical Info

When a VPME Multilingual application finds a string it needs to add, it creates a record in the Strings table. It enters the following into the record fields:

·       CSTRINGID: The first 50 characters of the string.

·       CUSEID: “C” for compile-time constants, “R” for report/label labels, “M” for  menu prompts and messages and the contents (if any) of an object’s i_cUse_ID property for the other types of strings.

·       MLOCATION: If the string is a property value from a form or a control on a form, the form name; otherwise, nothing.

The string type selections that you make in the Add Missing Strings column on the Properties page of the Language Builder are stored as properties of your application’s Multilingual object (_screen.oApp.oInt). Each property’s name begins with “lAddRecs_” and ends with the string type name used in the Add Missing Strings column. For example, your selection for the Caption string type is stored in the lAddRecs_Caption property of the Multilingual object. See the Multilingual Classes chapter in the VPME Technical Reference manual for a description of the Multilingual class properties.

More:

String Builder or String Manager - Manual Entry