Promotic

RtLang - property of the Pm object

Description:
The language version of the runtime application.
Syntax:
String RtLang
Values:
The property returns or sets a text identifier of the language (e.g. "en", "cs" ...). See How to create an application using different national languages.
Note:
Property access for read and write. The default value of this property is defined in the "Main language of runtime" configurator of the PmaRoot object.
 
This property is also functional in Web panels.

The value of this property influences selecting the text by Macro expression $.text.

If the language version is changed in runtime by writing into this property, then the change should be made in the PmaRoot.onAppStartBegin event.

If it is written into the property later while starting or running the application, then some parts of PROMOTIC needn't reflect the change of the language. For example the panel that is already open will not refresh the displayed texts - it is necessary to reopen it.
In such case it is recommended to call the Pm.RestartGui method after setting the property. See Example3.

The font palette is automatically created again after the language is changed so the panel uses the new fonts when it is opened the next time.
Example1:
Detects the currently active language
JavaScriptVBScriptSelect and copy to clipboard

Pm.Debug("Language=" + Pm.RtLang);
Example2:
The command in the PmaRoot.onAppStartBegin event sets the language after the application is launched according to the value defined in the config.ini file (section [runtime], key rtlanguage)
JavaScriptVBScriptSelect and copy to clipboard

Pm.RtLang = Pm.IniFileRead("#cfg:config.ini", "runtime", "rtlanguage", "en");
Example3:
Changes the application language and reopens all windows so the language change is visible
JavaScriptVBScriptSelect and copy to clipboard

Pm.RtLang = "en";
Pm.RestartGui();
Example4:
Switching the application language to the Windows OS user language:
JavaScriptVBScriptSelect and copy to clipboard

Pm.RtLang = Pm.GetSystemInfo("win.lang", "");

History:
Pm9.00.02: writing is also enabled for Web panels
Pm8.01.00: Created
PROMOTIC 9.0.27 SCADA system documentation MICROSYS, spol. s r.o.

Send page remarkContact responsible person
Navigation:
 
- Pm
 
- Abs
- Cos
- E
- Exp
- LN2
- PI
- Pow
- RtLang
 
 
- Sin
- Tan
© MICROSYS, spol. s r.o.