|
|
|
|
|
- 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
Translating programming messages
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. Translating messages (version 27 and later) Translating the current message (version 27 and later) To translate the message during the input: - Select the text to translate.
- Select "Translate" in the context menu. The window for translating messages is displayed.
- 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. - 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.
Messages used multiple times It is still possible to use the same message in different processes: simply declare a Constant in the project. - 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. - Use the constant at different parts in the code, where the message is to be used.
- 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. Converting character strings in the code into multilingual messages To convert strings in the code into multilingual messages: - On the "Code" tab, in the "Languages" group, expand "Translate strings" and select "Convert simple strings into multilingual messages".
- Select the elements where the conversion must be performed.
- 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. - 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: - 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).
- Select the element containing the resources (messages to translate).
- 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: - 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.
- Specify the text to find.
- 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: - On the "Code" tab, in the "Languages" group, expand "Translate strings" and select "Find unused messages". The multilingual message optimization wizard starts.
- 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: - Select the text to translate.
- Select "Translate" in the context menu. The window for translating messages is displayed.
- 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. - 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.
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: - Copy the initial message (Ctrl + C).
- Go to the code of the element where the message will be pasted.
- On the "Home" tab, in the "Editing" group, expand "Paste" and select "Special paste".
- 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 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 ( ).
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|