|
|
|
|
|
- Overview
- Defining the application language programmatically
- Default language
- Changing the language programmatically
- Tip
- Mechanism of preferred languages for the external components
Managing the application language programmatically
A multilingual application can be distributed in multiple languages. The user will be able to choose the language used by the application at runtime. You can for example: - prompt the user to choose the runtime language the first time the application is started,
- include an option (menu option or button, for example) to allow users to change the language while the application is running.
Defining the application language programmatically Default language When running the project, the default language is selected in the project options: - on the "Proyecto" tab, in the "Proyecto" group, click "Descripción".
- select the "Languages" tab.
- select the default language in the list of project languages and select "Default language" in the context menu.
The change of language is performed programmatically. Changing the language programmatically To change language through programming: - Call Nation and pass the selected language as parameter. The selected language will be taken into account by the first WLanguage function called after Nation and for all the windows, pages and reports that will be opened thereafter.
- Call LoadError to load the message error file of the components (WD*.DLL files) in the selected language. The error message file has a WDM extension.
Remarks:- If a message file is associated with the language chosen in the project description, there is no need to use LoadError.
Reminder The message file is defined in the "Miscellaneous" tab of the project description. Reminder: to display the project description, under the "Proyecto" pane, in the "Proyecto" group, click on "Descripción". Select the "Languages" tab. - The error messages of the components are in English by default. They can be translated with WDINT.EXE. WDINT is an additional tool. Contact PC SOFT Sales Department for more details about the conditions for using this program.
- If your application manages languages using specific character sets (Greek, Korean, etc.)change by programming:
Example of initialization process of project: // The language is chosen via RADIO_ChooseLanguage SWITCH RADIO_ChooseLanguage CASE 1: // French Nation(nationFrench) CASE 2: // English Nation(nationEnglish) IF LoadError("ENGLISH.WDM") > 0 THEN Error("Message file not found.",... "The messages will be displayed in French.") END CASE 3: // Spanish Nation(nationSpanish) IF LoadError("SPANISH.WDM") > 0 THEN Error("Message file not found.",... "The messages will be displayed in French.") END CASE 4: // Greek Nation(nationGreek) IF LoadError("GREEK.WDM") > 0 THEN Error("Message file not found.",... "The messages will be displayed in French.") END ChangeCharset(charsetGreek) ChangeKeyboard(charsetGreek) END
Tip Several methods can be used to choose the project language: - Stored in a parameter file. In this case, the change of language can be performed in the initialization process of the project and it will effective from the first window or page of the project.
- Chosen by a menu option. In this case, the menu will be displayed in the default language and the change of language will be performed when the next window or page is opened.
Mechanism of preferred languages for the external components
Esta página también está disponible para…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|