Promotic
Login logon

How to switch national languages in runtime

The PROMOTIC system allows switching between multiple national languages even while the application runtime is running.
Press the button "Settings" (gear wheel) in the toolbar. Then, in the "Language" option, select the runtime language.

If you do not see the "Language" option, then your application does not have the option to switch between multiple national languages enabled.

How to enable switching between multiple national languages:

Enabling selection of multiple national languages when creating the application

If you know before starting application development that you want to run the application in multiple national languages, then when creating the new application, check the "Multilingual application" configurator.
Then, in the "All used languages" configurator, specify the national languages to be used.

Adding multiple national languages to an existing application

If you did not check the "Multilingual application" configurator when creating the application, you must modify the event scripts of the "Settings" button (gear wheel), located in the Toolbar.

Add the following code snippet to the onMenuFill event script before the line pEvent.Menu.AddMenu("about", sAbout);:
JavaScriptSelect and copy to clipboard

//#pragma variable sLang = Macro("$.text('sys','Language')")

// National language selection:
var aLang = Pm.GetRtLangs("what:idtitlearray;");
var nLang = aLang.GetSize(2);
if (nLang > 0)   // Only if there are multiple national languages
{
pEvent.Menu.AddMenu("", "", "type:separator;");
pEvent.Menu.AddMenu("lang", sLang, "type:menu;");
var iLang;
for (iLang = 0; iLang < nLang; iLang++)
{
pEvent.Menu.AddMenu("lang/" + aLang.GetItem(0, iLang), aLang.GetItem(1, iLang));
}
}


In the script of the onMenuSelect event, add the following code section to the default branch of the switch command:
JavaScriptSelect and copy to clipboard

// Add the following to the default branch of the switch statement:
if (0 == Pm.StringFind(pEvent.Name, "lang/", 0))
{
Pm.RtLang = Pm.StringReplace(pEvent.Name, "lang/", "");
Pm.RestartGui();
}
See also:
- Pm.GetRtLangs (method)
- Pm.RtLang (property)
- Pm.RestartGui (method)
PROMOTIC 9.0.34 SCADA system documentation MICROSYS, spol. s r.o.

Send page remark Contact responsible person
© MICROSYS, spol. s r.o.Update cookies preferences