- 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 multiple languages
- Translation method
- Languages that use a specific character set
- Translating specific pages
- Translating WLanguage code messages
- Choosing the language through 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 project elements (pages, code, etc.) in the different project languages.
- Defining the project language through 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, etc.), the corresponding character set will be automatically used when translating to these languages.
- If your site is multilingual, this feature must also be managed in the User Groupware pages and in the HFSQL automatic error handling pages. For more details, see the online help.
- HFSQL data files and page controls support the Unicode standard.
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" tab, in the "Project" group, click "Description". The project description window appears.
- In the "Languages" tab, you can add or delete the languages supported by the project.
The selected languages will be available for all multilingual resources that can be translated (captions of controls, menu options, help messages associated with a control, etc).
When changing the project language, changes will be automatically taken into account:
- for new elements or objects created in the WEBDEV editor,
- for all elements or objects opened in the WEBDEV editor.
The main language corresponds to the language used by default at runtime.
The "Languages" tab of the project description also allows you to define all language-specific options: number, currency, date, etc.
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 column of a Table control that displays numeric data (numbers, currencies, dates, times, durations, etc.), the input mask defined in the project language options will be automatically used. This option is available in pages.
At runtime, when an Edit control or a column in a Table control has a mask "Defined by the project", the input/display mask will automatically adapt according to the options selected in the project for the language displayed at runtime.
Remark: The language options also allow you to define the writing direction and the character set used ("Miscellaneous" 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. The same analysis can be shared between different projects that do not use the same languages. Therefore, the analysis might use more languages than the project.
To configure the languages supported by the analysis:
- Open the project analysis in the editor.
- Open the analysis description window: on the "Analysis" tab, in the "Current element" group, click "Description".
- Select the "International" tab.
The different languages set in the analysis will be available:
- when configuring the shared information of the items. The description of the controls bound to the items (options, captions, etc.) can be entered in the different languages supported by the analysis. When generating a "full RAD" or a page RAD, this information will be automatically taken into account for all languages common to the analysis and the project.
- for the information printed in the technical documentation (notes of data files or items).
Languages supported by the different project elements
By default, the different elements of the project (pages, reports, code, classes, etc.) support the same languages as the project in which they 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 multiple 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, some 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 through programming.
WEBDEV proposes several translation modes:
- Automatic translation of the UI via a specific translation tool, installed 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.
Translating the UI
For each element, multiple multilingual areas are displayed in the different tabs of 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:
- Open the WEBDEV options to configure the translation options of the software used: on the "Home" tab, in the "Environment" group, expand "Options" and select "General options of WEBDEV".
- In the "Translation" tab, choose:
- the default translation tool.
- 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.
- Select the text to be translated and click "Translate".
Exporting and reintegrating the information to translate
WDMSG is a tool used to extract all the messages of the project (control captions, etc.) and reintegrate them once they have been translated.
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, etc.), you must enter the translation of the different messages using these specific character sets.
WEBDEV allows you to automatically manage the use of specific character sets in the editor.
When the text cursor is located in the input area of a language that uses a specific character set, the corresponding input language (character set used by the keyboard) is automatically enabled.
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
Handling HFSQL errors
By default, HFSQL error management pages are provided in English and French. To translate them into another language, you must:
- Include the default error pages in your project. These pages are provided 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 available in English and French.
To translate a site that uses the User Groupware, select the "Manual start" mode when integrating the User Groupware into the site. Reminder: To configure the User Groupware, go to the "Project" tab, "Project" group and click "User Groupware".
The different pages of the User Groupware will be included in your project. Then, all you have to do is translate these pages.
Translating WLanguage code messages
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 be translated.
- Select "Translate" in the context menu of the selection. The window for translating messages is displayed.
- Type the translation and validate. The line of code is displayed in the code editor:
- The icon indicates that this string has been translated to other languages. Click the icon to open the translation window.
- To see the existing translations, simply hover over the icon.
Remark: To convert all the messages in your code into multilingual messages, go to the "Code" tab, "Languages" group, expand "Translate strings" and select "Convert simple strings into multilingual messages".
Choosing the language through programming
A multilingual site is an application that can be distributed in several 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.
- implement an option (menu option or button for example) allowing the user to change the current language of the application.