- Choosing the languages supported by the project and the analysis
- Languages supported by the project
- Languages supported by the analysis
- Languages supported by the different project elements
- Translating the interface into several languages
- Selected translation mode
- Languages that use a specific character set
- Translating specific pages
- Translating messages found in the WLanguage code
- Choosing the language by programming
7. Multilingual sites in practice
A multilingual site can be distributed in several languages. The different languages of the site will be taken into account during the different development steps.
The main steps for developing a multilingual site are as follows:
- Choosing the languages supported by the project and the analysis.
- Entering the different project elements (pages, code, ...) in the different project languages.
- Defining the project language by programming.
- Managing specific character sets in the data files.
- Creating the library and the setup program.
- If the operating system supports several languages (Hebrew, Arabic, Greek, ...), the corresponding character set will be automatically used when typing translations in these languages.
- If your site is a multilingual site, this feature must also be managed in the pages of user groupware and in the pages for automatic management of HFSQL errors. See the online help for more details.
- Unicode support is available in HFSQL data files and page controls.
Choosing the languages supported by the project and the analysis
Languages supported by the project
The different languages supported by the project are defined in the project description:
- On the "Project" pane, in the "Project" group, click "Description". The project description window appears.
- In the "Languages" tab, you have the ability to add or delete the languages supported by the project.
The selected languages will be proposed for all multilingual resources that can be translated (captions of controls, menu options, help message associated with a control, ...).
When modifying the project languages, the modifications will be automatically taken into account:
- for each new element or object created in the WEBDEV editor,
- all each element or object opened in the WEBDEV editor.
The main language corresponds to the language used by default at runtime.
The "Languages" tab of the project description is also used to define the options specific to a language: number, currency, date, ...
The parameters used by default are the ones defined in the Windows language options (accessible from the Windows control panel).
When creating an edit control or a table column that displays numeric data (number, currency, date, time, duration, ...), the input mask used will be the mask defined in the language options of project. This option is available in pages.
At runtime, when an edit control or a table column has a mask "Defined by the project", the input mask and/or the display mask will automatically adapt according to the options selected in the project for the language displayed at runtime.
Remark: The linguistic options are also used to define the writing direction and the character set used ("various" option).
Languages supported by the analysis
If your project uses an analysis, the languages supported by the analysis are selected in the data model editor. Indeed, the same analysis can be shared among different projects that do not propose the same languages. Therefore, the number of languages defined for the analysis can be greater than the one defined for the project.
To configure the languages supported by the analysis:
- Display the analysis of your project in the editor.
- Open the analysis description window: on the "Analysis" pane, in the "Current element" group, click "Description".
- Select the "International" tab.
The different languages configured in the analysis will be proposed:
- when configuring the shared information of items. The description of the controls linked to items (options, captions, ...) can be typed in the different languages supported by the analysis. When generating a "full application RAD" or a page RAD, this information is automatically taken into account by all the languages common to the analysis and to the project.
- for the information printed in the program documentation (notes of data file or item).
Languages supported by the different project elements
By default, the different project elements (pages, reports, code, classes, ...) support the same languages as the project where they have been were created.
In some cases, an element may support more languages than the project (when the element is shared between several projects that support different languages for example).
Translating the interface into several languages
When the languages supported by the project have been selected, the information displayed by the site must be translated into these different languages.
To translate the interface into several languages, several elements must be taken into account:
- The selected translation mode.
- The supported languages.
- The use of specific pages (user groupware, automatic management of HFSQL errors).
- The messages displayed by programming.
Selected translation mode
WEBDEV proposes several translation modes:
- Automatic translation of interfaces via a specific translation tool, found on the development computer. This translation is performed in the WEBDEV editor.
- Export all the messages via WDMSG and reintegrate them once they have been translated.
For each object, several multilingual areas are displayed in the description window. These multilingual areas allow you to enter information in the different languages supported by the project.
To translate this information from WEBDEV:
- Display the WEBDEV options for configuring the translation options of software used: on the "Home" pane, in the "Environment" group, expand "Options" and select "General options of WEBDEV".
- In the "Translation" tab, choose:
- the default translation tool (as well as the transmission mode for the text to translate and for the translated text).
- the source and destination languages for the translation.
- If a translation tool is specified, a "Translate" button will be displayed in each element containing information to translate. This button is used to translate the selected text via the specified translation tool.
- To perform the translation, all you have to do is select the text to translate and click the "Translate" button.
Exporting and reintegrating the information to translate
WDMSG is used to check out all the project messages (captions of controls, ...) and check them back in after translation.
Contact PC SOFT Sales Department for more details about the conditions for using this product.
Languages that use a specific character set
If your site supports languages that use specific character sets (Greek, Russian, ...), you must enter the translation of the different messages by using these specific character sets.
WEBDEV allows you to automatically manage the use of specific character sets in the editor.
Indeed, as soon as the edit cursor of the mouse is located in an input area of a language that uses a specific character set, the corresponding input language (character set used by the keyboard) is automatically displayed.
Therefore, if a caption is entered in the Russian section of the caption description, the keyboard will automatically switch to the Russian character set.
Reminder: To use specific character sets, the files corresponding to the desired character sets must be installed in the Windows region settings (control panel).
Translating specific pages
Management of HFSQL errors
By default, the pages for managing the HFSQL errors are supplied in English and in French. To translate them into another language, you must:
- Include the default error pages in your project. These pages are supplied as example in \Programs\Data\Preset pages\HFSQL - Automatic help pages.
- Customize the management of errors to use the HFSQL pages for error management (HOnError).
- Translate the different messages (see previous paragraph).
By default, the user groupware is supplied in English and in French.
To translate a site that uses the user groupware, you must choose the "Custom" mode when the user groupware is included in your site. Reminder: To configure the user groupware, go to the "Project" pane, "Project" group and click "User groupware".
The different pages of user groupware will be included in your project.
Then, all you have to do is translate these pages.
Remark: Uncheck "AutoRun" if necessary: this allows you to display a page for language selection before starting the login page.
Translating messages found in the WLanguage code
In your code, several WLanguage functions allow you to communicate with users via character strings. These messages must also be translated into the different languages of your site.
To translate a character string typed in the code editor:
- Select the character string to translate.
- Select "Translate" in the context menu of the selection. The window for translating messages is displayed.
- Type the translation and validate. The code line is displayed in the code editor:
- The flag indicates that translations exist for this character string. Click this flag to display the translation window.
- The number (2 in our example) indicates the number of translations typed for this character string.
Remark: To transform all the messages in your code into multilingual messages, go to the "Code" pane, "Languages" group, expand "Translate strings" and select "Convert simple strings into multilingual messages".
Choosing the language by programming
A multilingual site 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.
- implement an option (menu option or button for example) allowing the user to change the current language of the application.