Click the Create String Records button on the Language page of the VPME Language Builder to create String and String Translations records for strings that are in known locations, such as the VPME data dictionary, reports and system tables.
You access the Language Builder from the Visual ProMatrix Tools menu.
String Types Searched
The Create String Records utility lets you choose which types of strings the utility should add to the Strings table. The Create String Records utility searches for the following types of strings:
· Control Descriptions (Control Security): These are the Control Descriptions that you enter in the Control Groups form when you set up controls security for your application. You access the Control Groups form from the Security Builder submenu on the VPME Tools menu. Control Descriptions are stored in the Control Security Control Group Definitions table, SVPMControlGroupDefinitions.dbf.
· F3 Help Text: You enter F3 Help text on the Edit - Help page in the VPME Data Builder. F3 Help text is stored in an application’s SDATADDFH.dbf table
· Index Tag Descriptions: You enter Index Tag Descriptions on the Edit page of the Data Builder. Index Tag Descriptions are stored in an application’s SDATADDIT.dbf table.
· Menu Titles: Menu titles are the titles shown and entered on the VPME Menu Builder. Menu titles are shown in a VPME application on the Menu Permissions form. Menu titles are stored in an application’s SVPMMenus.dbf table
· Report/Label Labels: Report and label labels are found in report files.
· Set Integrity Descriptions: Set Integrity Descriptions are the descriptions you enter on the Edit – Integrity page in the Data Builder when you are setting up Set validation for a field. Set Integrity Descriptions are stored in an application’s SDATADDSIF.dbf table.
· Table/View/CursorAdapter Descriptions: You enter Table/View/CursorAdapter Descriptions on the Edit – Properties page in the Data Builder. Table/View/CursorAdapter Descriptions are stored in an application’s SDATADDTV.dbf table.
Running the Create String Records Utility
When you have created all or most of the types of strings described in the preceding section, you are ready to run the Create String Records utility. If you add more of these types of strings to your application, simply rerun the utility to create String and String Translations records for the strings you have added.
Ř To run the Create String Records utility
1. Language Builder: Open the Language Builder from the Tools menu in VPME.
2. Select Language: Select the language for which you want to run the Create String Records utility.
3. Select String Types: Click the Create String Records button on the Language page. VPME displays the Create String Records form.
The Create String Records form lets you choose which types of strings the utility should add to the Strings table. (The string types are described in the preceding section.) By default all the types of strings that are searched for are selected. You may want to unselect a type if you have not yet entered strings of that type.
For example, if you have not yet entered F3 Help Text in your application, you may want to uncheck the F3 Help Text box to reduce the time the utility will take. Similarly, if you are rerunning the utility, to save time you may want to uncheck the string types for which you have not added any strings since you last ran the utility.
4. Run Utility: After you have selected the types of strings, click the Create button to run the utility.
5. Repeat for Each Language: Normally, you would want to create String and String Translations records for each language in an application. Therefore, repeat steps 2 through 4 for each language in your application. You will then have created String and String Translations records for each language.
When the Create String Records utility finds a string, it creates a record in the Strings table and the Strings Translations table. It enters the following into the record fields:
· CSTRINGID: The first 50 characters of the string.
· CUSEID: “F3” for F3 Help, “R” for report/label labels, and nothing for the other types of strings.
· MLOCATION: The name of the file that contains the string.
When the Create String Records utility goes through a report/label file to create String and String Translations records for label (text object) strings, the label in the report/label file is converted into an expression. The expression is a call to the program TranStr.prg (Translate String). The program is passed the string and an “R” Use ID value that identifies the string as a report/label string. For example, the following call to TranStr.prg, passes the string “Date” and the “R” Use ID:
String and String Translations records for report/label strings are given the “R” Use ID to make it easy for you to create translations that are specific to reports. For example, the string “First Name” may need abbreviated translations for reports while full translations of “First Name” may be just fine for forms. The “R” Use Id lets you enter translations of “First Name” for reports that are different than the translations you enter when “First Name” is used for forms. The String record for “First Name” when used for forms would have a Use ID that is blank or different than “R”. See How to Create Alternative Translations for the Same String.
Tip: Instead of entering labels (text objects) in reports, you can enter the expression “TranStr(“LabelText”,”R”)” directly, where LabelText is the label text string. You might want to do this when you are modifying an existing report by adding just a few labels. You could then either create a String record manually for the label or let VPM’s “Add Missing Strings” functionality create the String record (see Add Missing String Records).
When a report/label is run, the TranStr program returns the translated string that will appear in the report/label. TranStr runs the TranslateString method of the Multilingual object , _SCREEN.oApp.oInt, passing on the parameters and returning the translated string.
A function call is used instead of a call to the TranslateString method for two reasons:
· The call to TranStr is shorter than a call to a method of the Multilingual object, making it easier to see the expression string in the Report Designer.
· TranStr can test to see if the Multilingual object has been instantiated, and if not, simply return the string it tried to pass. This allows the report/label to be run outside the application (like in VPM’s Report Builder) where the Multilingual object has not been instantiated.