Is it possible to have Multiple Languages function also include certain variables accessible via scripting?
For instance, it would be nice if when the script puts up a message box the text were in the selected language rather than the default language used in the script.
Multilanguage support for script variables
-
- Posts: 19
- Joined: Tue Jan 17, 2012 8:57 am
Multilanguage support for script variables
Bob Livingston
Sr Controls Engineer
FlexEnergy Energy Systems
30 New Hampshire Ave
Portsmouth, NH 03801
USA
Sr Controls Engineer
FlexEnergy Energy Systems
30 New Hampshire Ave
Portsmouth, NH 03801
USA
Re: Multilanguage support for script variables
One way to do this would be to set a tag to a value every-time you changed a Language, then use this internal integer tag to determine what the current language is in your script. There isn't a System Tag or anything in Globals that tells what the current language is, but using actions it should be very straightforward to change a value of an internal tag whenever the language is changed.
Best Regards,
Beijer Electronics, Inc.
Ron Lloyd | Applications Engineer
Beijer Electronics, Inc.
Ron Lloyd | Applications Engineer
Re: Multilanguage support for script variables
Hi,
So i suppose there is no script instruction which allows define current language?
Best regards,
antoineA.
So i suppose there is no script instruction which allows define current language?
Best regards,
antoineA.
Re: Multilanguage support for script variables
You can change languages based off of a tags value. You would add this logic under the Functions "Tags" -> "Tags" tab -> "Action" column.
If you would like to change this language tags value in script, the code would look something like:
If you would like to change this language tags value in script, the code would look something like:
Code: Select all
Globals.Tags.Tag1.Value = 2;
Best Regards,
Beijer Electronics, Inc.
Ron Lloyd | Applications Engineer
Beijer Electronics, Inc.
Ron Lloyd | Applications Engineer
-
- Posts: 19
- Joined: Tue Jan 17, 2012 8:57 am
Re: Multilanguage support for script variables
Can't you just change the language using the MutiLanguage function:
Globals.MultipleLanguages.SetLanguage("Default");
Globals.MultipleLanguages.SetLanguage("Default");
Bob Livingston
Sr Controls Engineer
FlexEnergy Energy Systems
30 New Hampshire Ave
Portsmouth, NH 03801
USA
Sr Controls Engineer
FlexEnergy Energy Systems
30 New Hampshire Ave
Portsmouth, NH 03801
USA
Re: Multilanguage support for script variables
That didn't show up in my auto-complete in script, but that code does compile.
Best Regards,
Beijer Electronics, Inc.
Ron Lloyd | Applications Engineer
Beijer Electronics, Inc.
Ron Lloyd | Applications Engineer