Online language switching

Project languages can be switched at runtime without having to restart the UI manager. The benefit of changing the language in a UI is that the language of all panels and modules that were opened with the user interface manager is changed at runtime. This way all plant displays and configuration panels on the main computer can remain open and the language can be switched easily with a few mouse clicks.

The project language can be switched in the UI via either the menu or the tool bar. The online language switch changes the language of the CURRENT module. In addition, the language can be switched via the switchLang() CONTROL function. The function switches the language of the WHOLE panel, not just the module. This function can be used in user-defined CONTROL scripts.

After starting a user interface a combo box that allows selecting a language is shown in the tool bar. However, in contrast to the function switchLang(), switching the language via this combo box does not change the local settings, for example, the time and date format, display format of float variables etc.

You can use this same combo box in graphics editor (GEDI) to switch between project languages, i.e. show the content of the panels in different languages.

Figure 1. Combo Box for Language Switching

The file dialog (used to open files) is related to the operating system. If the operating system is English, the dialog is English as well.

"LangChange Redraw Only"

Each panel contains for compatibility reasons an additional property "LangChange Redraw Only" and an additional event "LangChanged". The "LangChange Redraw Only" defines how the panel is processed when the language is changed. you can use the following two settings.

  1. LangChangeRedraw only, TRUE: The switching is executed by "redrawing" all static panel texts and by executing the "LangChanged" event. Use this option with new panels that have no "Initialize" scripts defined for setting a specific text to objects.

When using the option "LangChange Redraw only = TRUE", you have to use global variables carefully in the script "LangChanged". When the language is switched, the script "LangChanged" is executed. If the language is switched shortly after that again, the script that was started first continues to run and additionally the script is restarted. Thus, unwanted results can occur when executing scripts (for example, values of the global variables are forged). Ensure that either global variables are not used in "LangChanged" or the language is switched again when the execution of the first script is finished!

  1. LangChange Redraw only, FALSE (Default): With the "FALSE" option, in addition, all child panels are closed, all CTRL scripts stopped (including the script with the switchLang() function) and all "Initialize" executed. This option is activated by default and should be used with older panels that transfer texts to objects at initialization.