PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Overview
  • Defining the application language by programming
  • Default language
  • Changing the language by programming
  • Tip
  • Mechanism of preferred languages for the external components
  • Principle
  • Sequence of preferences
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Overview
A multilingual application is an application that can be distributed in several languages. The user will be able to choose the runtime language of application. You can for example:
  • ask for the runtime language during the first application start,
  • include an option (menu option or button for example) allowing the user to change the current language of the application.
Defining the application language by programming

Default language

When running the project, the default language is selected in the project options ("Project .. Project description .. Languages"). The change of language is performed by programming.When running the project, the default language is selected in the project options:
  • on the "Project" pane, in the "Project" group, click "Description".
  • select the "Language" tab.
  • select the default language in the list of project languages and select "Default language" from the popup menu.
The change of language is performed by programming.

Changing the language by programming

To change language by programming:
  1. Call Nation and pass the selected language in 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.
  2. Call LoadError to load the file of error messages of the components (WD*.DLL files) in the selected language. The file of error messages is a file whose extension is WDM.
    Notes:
    • 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 "Framework translation" column of the project description ("Project .. Project description", "Languages" tab). Reminder: The message file is defined in the "Various" tab of the project description ("Project .. Project description", "Languages" tab). Reminder: The message file is defined in the "Various" tab of the project description.
      Reminder: to display the project description, on the "Project" pane, in the "Project" group, click "Description". Select the "Language" 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 product.
  3. If your application supports languages that use specific character sets (Greek, Korean, ...), you must 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
Java To change the language by programming, all you have to do is call Nation with the selected language in parameter. The selected language will be taken into account by the first WLanguage function called after Nation and for all the windows that will be opened thereafter.

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
WINDEVWEBDEV - Server codeWindowsWindows Mobile

Principle

If an external component used in the project supports less languages than the project that is using it (or different languages), the mechanism of preferred languages is used to display the requested information (coming from the external component) in a language close to the requested one.
Example: An external component proposes a window that was translated into French, English and Russian. A menu option in the application that uses the external component allows this window to be displayed in German.
The mechanism of preferred languages searches for the German language, the English language and the American language.
In our example, the window will be displayed in English.
Benefit: if you are using an external component that does not support the same languages as your application, a translation will always be displayed (even if does not exactly correspond to the requested language).
Note: The interface of the external component can also be translated into the requested language. See Translating the external components for more details.
WINDEVWEBDEV - Server codeWindowsWindows Mobile

Sequence of preferences

The requested language is sought by default.
If this language is not found, the English translations will be sought first and displayed.
If English is not associated with the element, the American is sought and displayed.
Special cases:
  • If English is sought and not found, then American will be sought.
  • If American is sought and not found, then English will be sought.
  • If French Canadian is sought and not found, French will be sought then American and English.
  • If Portuguese is sought and not found, Brazilian Portuguese will be sought, then English and American.
  • If Brazilian Portuguese is sought and not found, Portuguese will be sought, then English and American.
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment