- Managing the languages and the character set
- Nation function and file of error messages
- Identifier of languages
- Changing language
- Change of language and help file
- Change of language and User Groupware
- Changing languages and framework messages
In french: Nation
Defines or identifies the display language (captions, messages, ...) used for the windows, pages, reports and controls.
This function allows you to develop international applications that can be distributed in several languages.
<Language number>: Integer or Integer constant
Identifier of language to use (value defined in the project editor). This identifier can be returned by GetCountryList.
The list of identifiers is specified in the Remarks.
The change will be effective:
- immediately if "Change language immediately after the call to WLanguage Nation function" is selected in the "Languages" tab of the project description.
Retrieving the number of the current language Hide the details
<Result> = Nation()
<Result>: Integer or Integer constant
Identifier of language currently used (see the Notes).
Managing the languages and the character set
By default, captions and messages are displayed in the default language, which is selected in the "Languages" tab of the project description window ("Default language" in the context menu of the list of languages).
allows you to find out and modify the character set used. When changing language (Nation
), if the new language is using a different character set, this character set must be changed by ChangeCharset
To change the language of current system, use SysNation.
Nation function and file of error messages
is used to load the error message file in the desired language.. This function is independent of Nation
If an error file is available for each language supported by the application (or the site), this WDM file must be reloaded after each change of language performed by Nation.
Identifier of languages
The identifiers of languages are as follows:
- Nation changes the runtime language.
The change will be effective:
After the call to Nation, the windows, the pages, ... display the titles, the captions, ... in the requested language.
- immediately if "Change language immediately after the call to WLanguage Nation function" is selected in the "Languages" tab of the project description. If this option is not checked, the change of language will be performed when the next window is opened.
- To modify the language of the current window or page, you must:
- check "Change language immediately after the call to WLanguage Nation function" in the "Languages" tab of the project description.
- redisplay the relevant window (or page) with Use (or PageUse or FramesetUse), after the call to Nation.
- Translation not found:
If the translation of a window, page, message, ... was not performed for the specified language (the element is not associated with this language), the mechanism of preferred languages displays the information in a language close to the desired one. For more details, see Managing the application language through programming.
- Changing language via a menu option:
If the change of language is performed via a menu option:
- the menu language changes automatically if "Change language immediately after the call to WLanguage Nation function" is checked in the "Languages" tab of the project description.
- the menu remains in the language selected by default. To modify the menu language, you must redisplay:
- the relevant window with Use after the call to Nation.
Change of language and help file
In the WINDEV help editor, the name of the help file can be built from a numeric identifier corresponding to Nation.
In this case, to start the help file corresponding to the current language, all you have to do is use the following code:
// Start the help in CHM format
WHelp("MyFile" + Nation + ".chm")
Change of language and User Groupware
If you are using the User Groupware, the windows specific to the User Groupware come in two languages: French and English.
Changing languages and framework messages
The framework language automatically adapts to the application language defined by Nation
. For example:
Nation(nationFrench) // framework in French
Nation(nationFrenchCanadian) // framework in French
Nation(nationSpanish) // framework in Spanish
Nation(nationCatalan) // framework in Spanish
// Other case:
// Nation(nationxxx): framework in English
allows you to force the use of one of the languages for the framework.
This page is also available for…