RtLang - property of the Pm object
Description:
The language version of the runtime application.
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);
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");
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();
Pm.RtLang = "en"
Pm.RestartGui