If multiple languages have been configured in a Galaxy, you can manage the languages and locales in an application. This allows users to implement multiple languages/locales in your application during configuration, and to change the language during run time. Three attributes in the language namespace are provided for setting language and locale:
- MyViewApp.Language.CurrentLanguage: This attribute contains the current language, for example, "English," and can be set during run time to change the application language.
- MyViewApp.Language.CurrentCultureInfo: This attribute contains locale-type information, for example, "en-US," and can be set during run time to change the locale.
- MyViewApp.Language.CurrentLCID: This attribute contains a numeric identifier that corresponds to the locale, for example "1033," , and can be set during run time to change the locale. Some CurrentLCID examples are:
- 1033: English, United States
- 1036: French, France
- 1041: Japanese, Japan
- 2057: English, United Kingdom
-
In addition, the language namespace includes three properties. All use an array that holds language and locale IDs that are currently configured.
- Languages
- Lcids
- CultureInfos
Attributes
Language attributes are exposed through the SDK. A dropdown list of languages that have been configured in the Galaxy is displayed in the ViewApp, and users can then change the ViewApp language during run time. One of the consumers is the Titlebar sample app, where you can see a dropdown when the Language property is enabled in the app. You can use the same language namespace attributes and properties in your own custom apps.
CurrentLanguage Attribute
The CurrentLanguage attribute holds the currently-configured language for the ViewApp. The CurrentLanguage method returns the currently-configured language for the ViewApp.
CurrentLanguage Copy Code/// <summary> /// Gets or sets the current language. /// </summary> /// <value> /// The current language. /// </value> public static string CurrentLanguage
CurrentLCID Attribute
The CurrentLCID attribute holds the currently-configured locale ID for the ViewApp. The CurrentLCID is an integer value that corresponds to the currently-selected language for the ViewApp.
CurrentLCID Copy Code/// <summary> /// Gets or sets the current LCID. /// </summary> /// <value> /// The current LCID. /// </value> public static int CurrentLCD
CurrentCultureInfo Attribute
The CurrentCultureInfo attribute holds the currently-configured locale information, for example, EN-us (English-United States), for the ViewApp. The CurrentCultureInfo method returns the currently-configured locale for the ViewApp.
CurrentCultureInfo Copy Code/// <summary> /// Gets or sets the current CurrentCultureInfo. /// </summary> /// <value> /// The current CurrentCultureInfo. /// </value> public static string CurrentCultureInfo
Properties
Languages Property
The Languages property uses an array that lists the languages that are configured in language settings. The languages are set in the System Platform IDE (ArchestrA IDE), under Galaxy > Configure > Languages. The Languages property includes the Languages index. The Languages index number is exactly the same as the LCID index number in the LCIDs array and the CultureInfo index number in the CulturesInfo array.
Languages Copy Code/// <summary> /// Gets the list of configured languages. The Languages array will have the same size as the LCIDs array. /// The Language index within the Languages array, the LCID index within the LCIDs array, and the CultureInfos index within the CultureInfos array will all have the same index number. /// </summary> /// <value> /// The configured languages. /// </value> public static string[] Languages
Lcids Property
The Lcids property uses an array that lists the LCIDs (language and locale IDs) that are configured in language settings. The Lcids property is set in the System Platform IDE (ArchestrA IDE), under Galaxy > Configure > Languages. The Lcids property includes the LCID index. The LCID index number is the exactly the same number as the Languages index number in the Languages property and the CultureInfo index number in the CulturesInfo property.
Lcids Copy Code/// <summary> /// Gets the LCIDs. The LCID array will have the same size as the Languages array. /// The LCID index within the Lcids array, the Languages index within the Languages array, and the CultureInfos index within the CultureInfos array will all have the same index number. /// </summary> /// <value> /// The configured Lcids. /// </value> public static string[] Lcids
CultureInfos Property
The CultureInfos property uses an array that lists the CultureInfos numbers (language and locale IDs) that are configured in language settings. The CultureInfos property is set in the System Platform IDE (ArchestrA IDE), under Galaxy > Configure > Languages. The CultureInfos property includes the CultureInfo index. The CultureInfo index number is the exactly the same number as the Language index number in the Languages property and the LCID index number in the LCIDs property.
CultureInfos Copy Code/// <summary> /// Gets the Culture Information. The CultureInfos array will have the same size as the Languages array. /// The CultureInfos index within the CultureInfos array, the Languages index within the Languages array, and the LCID index within the Lcids array will all have the same index number. /// </summary> /// <value> /// The configured culture information. /// </value> public static string[] CultureInfos