SHIP:System Variable:shiplanguage

From Serious Documentation
Jump to: navigation, search
System Variable Data Type Permissions Description
shiplanguage Language Read/Write This variable sets/tracks the current system language in 4 letter codes system time. You can change these values, but they are only retained across power cycles if the platform has battery-backed RTCC capabilities.

Layout area text nodes with attached objects pointing to text or string resources will automatically be updated on the GUI when shiplanguage changes.

For example, setting shiplanguage to "esMX" (Spanish as used in Mexico) in a script like this:

shiplanguage = "esMX";

will cause the system language to immediately change to "esMX" and any text with translations for "esMX" will update automatically. If no translation exists, the default language resource will be used.

For text that is dynamically updated by scripts that needs to be translated, you can put a listener with the listeningto property set to shiplanguage to wake and take appropriate action whenever shiplanguage changes.

Permissible Values

shiplanguage can be set to any 4 letter combination of the form xyAB, where xy are lower case ASCII letters and AB are upper case ASCII letters. In a script, when assigning a string to shiplanguage, assigning any other value than a strict 4 letter string of this form is ignored.

Also, the value assigned to shiplanguage must be present in the current GUI's list of configured languages. This list is held in the system variable shiplanguages. An assignment outside the values in this list is ignored.

Persistence

The shiplanguage built-in variable is always a persistent variable, meaning whenever you assign a permissible value to it, it is automatically and immediately stored in a persistent storage system on the SIM, and this value is retrieved on reboot (see below, Value at GUI Launch).

The shiplanguage built-in variable has the following persistent identification:

  • Variable ID 0x0032
  • Context ID 0xFF
  • Version ID 0xFF

Value at GUI Launch

SHIPEngine, on GUI startup (or "launch"), checks to see if there is a previously saved value of shiplanguage in the persistent storage area. If so, and this saved value is in the acceptable list for the GUI (i.e. in the shiplanguages list), this is the initial value of shiplanguage on GUI launch. If there is no persistent saved value, or the value is not in the shiplanguages list, then the first entry in the shiplanguages list will be used.

See Also