ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / Editors / Code editor
  • Overview
  • Translating messages (version 27 and later)
  • Translating the current message (version 27 and later)
  • Messages used multiple times
  • Handling messages
  • Converting character strings in the code into multilingual messages
  • Browsing the messages to translate found in the different project elements
  • Performing a search within the translated messages
  • Finding and deleting unused messages
  • Characteristics of the message to translate
  • Characteristics
  • Displaying a message in a non-supported language
  • Translating messages (version 26 and earlier)
  • Translating the current message (version 26 and earlier)
  • Linked multilingual messages
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Overview
When developing a multilingual application, you can translate the different messages displayed to the user (messages displayed by Info and YesNo, for example).
This translation is written in the translated messages window.
Each translated message corresponds to a "resource".
A new method for handling multilingual strings was introduced in version 27. This method makes it easier to handle multilingual strings in the following cases:
  • merger of branches in the SCM,
  • messages in templates,
  • multilingual messages "linked" to multiple elements.
Projects created with version 27 use this method by default. For projects created with a previous version, a specific wizard allows changing to the new method. For more details, see Multilingual message migration wizard.
Remark: This help page presents the translation of multilingual messages with the new method. If you are using the previous method, see Translating messages (version 26 and earlier).
Remark: For more details on developing and programming a multilingual application, see Multilingual applications.
Translating messages (version 27 and later)

Translating the current message (version 27 and later)

To translate the message during the input:
  1. Select the text to translate.
  2. Select "Translate" in the context menu. The window for translating messages is displayed.
  3. Enter the translation of the message and validate.
    The icon in the language caption opens a menu for simplifying translations. For more details, see Typing multilingual texts.
  4. An icon appears to the right of the translated message. This icon indicates that the current message has multiple languages. The icon allows you to quickly access the translation window.
    When the icon is hovered over, a tooltip shows the different translations found for the string in all the project languages.
Remark: If your application supports languages that use specific character sets, you must type the translation of the different messages using these character sets. For more details, see Managing specific character sets in a multilingual application.

Messages used multiple times

It is still possible to use the same message in different processes: simply declare a Constant in the project.
  1. Declare and set the value of the constant.
    For example:
    CONSTANT
    ClosingSentence = "You are about to exit the application."
    END
    In this code, the constant contains the multilingual string to be shared.
  2. Use the constant at different parts in the code, where the message is to be used.
  3. Use Nation to dynamically change the language of the application. The value of the constant will automatically adapt to the language specified with Nation.
Reminder: You can use Nation to change the language of the entire application (UI, code, values of constants, etc.).
Caution: Using constants to reuse multilingual messages is not always recommended. For example, if you use WDTRAD to translate your applications, you can use the automatic translation feature to propagate translations when identical strings are found. This means that the text has to be translated only once.
Handling messages

Converting character strings in the code into multilingual messages

To convert strings in the code into multilingual messages:
  1. On the "Code" tab, in the "Languages" group, expand "Translate strings" and select "Convert simple strings into multilingual messages".
  2. Select the elements where the conversion must be performed.
  3. For each character string found, the editor proposes to convert or not to convert this string into a multilingual message.
    Remark: If "Re-use the existing messages" is checked, identical multilingual messages will correspond to the same resource.
  4. Validate the conversion.

Browsing the messages to translate found in the different project elements

To browse the different messages to translate found in the project elements:
  1. Display the window for typing the translated messages: on the "Code" tab, in the "Languages" group, expand "Translate strings" and select "Translate messages" (or press Ctrl + T).
  2. Select the element containing the resources (messages to translate).
  3. Use the arrow buttons to browse the resources. You have the ability to modify the messages or to add new messages at any time.

Performing a search within the translated messages

To perform a search in the translated messages:
  1. Enable the search: on the "Home" tab, in the "Find" group, expand "Find" and select "Find" (or press Ctrl + F). The "Find - Replace" pane is displayed.
  2. Specify the text to find.
  3. Specify the options:
    • Search in the code.
    • In the advanced options (), specify that the search must be performed in the multilingual strings found in the code.

Finding and deleting unused messages

To find and delete unused messages:
  1. On the "Code" tab, in the "Languages" group, expand "Translate strings" and select "Find unused messages". The multilingual message optimization wizard starts.
  2. Select the unused messages and finish the wizard to delete the selected messages.
Characteristics of the message to translate

Characteristics

  • A message displayed in an application must be translated into all the languages selected for the project.
  • A message can contain several lines.
  • A message can contains special characters (tabulation for example).
  • To type special characters, you must type the corresponding ASCII code. To do so, use the numeric keypad and enter the corresponding ASCII code (Alt + 09 for a tab, or example).

Displaying a message in a non-supported language

At runtime, if a message has not been translated to the specified language (i.e. if the message is not associated with this language), the mechanism of preferred languages displays the information in a language similar to the desired one.
Translating messages (version 26 and earlier)

Translating the current message (version 26 and earlier)

To translate the message during the input:
  1. Select the text to translate.
  2. Select "Translate" in the context menu. The window for translating messages is displayed.
  3. Enter the translation of the message and validate.
    The icon in the language caption opens a menu for simplifying translations. For more details, see Typing multilingual texts.
    Remark: Use to find a message. The "Find - Replace" pane is displayed with all the necessary options.
  4. An icon appears to the right of the translated message. This icon indicates that the current message has multiple languages. The icon allows you to quickly access the translation window.
    When the icon is hovered over, a tooltip shows the different translations found for the string in all the project languages.
Remark: If your application supports languages that use specific character sets, you must type the translation of the different messages using these character sets. For more details, see Managing specific character sets in a multilingual application.

Linked multilingual messages

A multilingual message can be copied/pasted at several locations in several processes or events of the same project.
Two options are available to copy the multilingual message:
  • the message is directly copied, without keeping the link with the original message (default).
  • the message is pasted and the messages remain linked: modifying a message also modifies the other linked messages.
To keep the link:
  1. Copy the initial message (Ctrl + C).
  2. Go to the code of the element where the message will be pasted.
  3. On the "Home" tab, in the "Editing" group, expand "Paste" and select "Special paste".
  4. The message is pasted and the link is kept. When the link is kept, a specific icon indicates that the multilingual message is used several times in the code.
The icon indicates that the multilingual message is used several times in the code. Therefore, a modification will impact all the uses
The icon indicates that the multilingual message is used several times in the code. Therefore, a modification will impact all the uses
In this case, the window for managing multilingual messages (opened by pressing Ctrl + T on the message) is used to know the different uses of the message ().
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 09/18/2023

Send a report | Local help