Setting Up Multiple Languages

Texts and tooltip texts for visualizations are managed in text lists and can be displayed in different languages. To switch a visualization between the available languages, configure a visualization element with the corresponding input configuration for changing the language.

There are static texts that are managed in GlobalTextList (generated automatically) and dynamic texts from created text lists. A dynamic text can be changed at runtime with a variable that defines the index of the text list entry. Static texts are fixed labels within a visualization; dynamic texts are often used for displaying variable values or error messages.

For creating and using text lists, see: Managing Text in a Text list: Managing Text in a Text List

Note

You can modify the appearance and formatting of texts and tooltips with the element properties Text properties and Font variables.

See also

Configuring the language switcher for texts from text lists

Requirement: An empty visualization object is inserted into the project and it is open for editing in the visualization editor. There is also a Visualization manager object. User management is not created for the visualization.

The following instructions provide a simplified example:

  • By means of two buttons, the user should be able to switch the visualization texts between English and German.

  • Static texts in the visualization include the labels “State, Machine 01”, “State, Machine 02”, “English”, and “German”. These texts are located in the GlobalTextList in English and German.

    Dynamic texts will describe the state of both machines. The texts are provided in the text list Status_Texts in English (en) and German (de).

  1. Drag a Text field from the ToolBox view (category Common controls) to the editor view. Specify the value State, Machine M01 in the properties editor for the element property Texts ‣ Text.

  2. Copy the element and change the copy label to State, Machine M02.

  3. See also the figure in step 14 for the following steps.

    Insert two elements of type Button from the ToolBox view (category Common controls) in the visualization editor. With these elements, the user should be able to change the language of the visualization. Specify the text German or English in the properties editor for element property Texts ‣ Text (4).

  4. Double-click and open GlobalTextList in the POUs view.

    The texts are entered in the Standard (1) column, and the IDs 0 and 1 are assigned automatically as additional information.

  5. Add the languages de and en with the texts shown in the following figure.

    ../_images/cacde7431af00a61c0a8640e01947fb2
  6. Close the GlobalTextList.

  7. Add two elements of type Rectangle from the ToolBox view (category Basic) in the visualization editor. The current state of each machine should be displayed.

  8. For managing the texts for describing the states, add an object of type Text list below the application. Name the list Status_Texts.

  9. Specify the texts shown in the figure for the standard language (1) and the target languages en and de in the editor of Status_Texts.

    ../_images/cffbd46f1aef8bbec0a8640e01eff3c8
  10. Close the text list Status_Texts.

  11. Select the rectangle element for displaying the state of machine M01. Select the text list Status_Texts from the combo box in the properties editor (2) for the element property Dynamic texts (5). Specify an application variable for Text index that shows the appropriate text index for the state of the machine at runtime. Example: PLC_PRG.ivar_status_m01.

  12. Now configure the user input for both buttons for switching the language in the visualization.

    Select the button “German”. Double-click Configure of the property Input configuration (6), OnMouseClick.

    The Input configuration / OnMouseClick dialog box opens.

  13. Select Change the language on the left. Click the arrows to accept the setting to the right. Select de in Language to the right of the dialog in the 21148b459ba21e06c0a8640e00643c58_21d51bd0cd4519c1c0a8640e00abb4b7 input assistant Click OK to confirm.

  14. In the same way, configure the entry for the second button: English: Text list: Status_Texts, Text index: 3, Change the language: English).

    The following figure shows the performed properties configurations for the four visualization elements.

    ../_images/cdfb8b9f1b12beb9c0a8640e01af03f0
  15. When the application is compiled without errors, you can test the visualization in simulation mode. Activate the option Online ‣ Simulation. Click Online ‣ Login.

    The visualization appears in the visualization editor view in online mode:

    ../_images/ae68aee723c613ecc0a8640e017d3cdf
  16. Click the German button.

    The language changes to German:

    ../_images/77297f6623c67214c0a8640e01c46eb6

See also

Setting up fonts for a language

The font for a visualization element is defined in the properties editor. If a language switch is provided, you can overwrite this basic font with another font for each language in the visualization manager.

Requirement: A visualization is set up with at least one language in addition to the default language. For an example, see <no title>

  1. Double-click and open the Visualization manager object and select the Font tab.

  2. Double-click the field in the Font line for a particular language. Select a font from the combo box.

  3. In the Font size line, replace the value 1 with a value greater than 1 (example: 2) in order to increase the size of the font as defined by the visualization style; or replace it with a value less than 1 in order to decrease is (example: 0.5).

    In online mode, the font changes depending on the set language.

See also