Supporting Device Culture Codes

Description

The device Culture code can be used to determine the language for your application when using language and text dictionary tags.

Discussion

The component builders allow you to wrap strings in either <a5:r>...</a5:r> or <a5:t>..</a5:t> tags so that you can define strings in different languages. At runtime you can specify which language definition to use by setting the value in a special session variable (session.__protected__activeLanguage).

A culture code can be read from the user's device to determine the language that should be used in an application. For example, a user whose machine is configured for UK English will have a culture code of "en-GB". You can configure your application to automatically select the language for your application using this culture code, rather than setting the session.__protected__activeLanguage variable.

To automatically select a language definition using the device's culture code, set the component's Active Language property to <culture>.

You can then define language definitions for the culture codes you wish to support in the text and language tag dictionaries. You must define language definitions to match the culture code. For example, to define a language for the "en-GB" culture code, you would define text dictionary and language dictionary settings for a Language called en-GB.

images/langDefCulture.png
Using Culture Codes for Languages in the Text Dictionary Tags dialog
images/textDictCulture.png
Using Culture Codes for Languages in the Language Definitions dialog

Finding the Culture code

You can pick from a list of culture codes to add to your Language and Text Dictionary tag definitions from the How to use the browser culture to automatically select the active language dialog. Click the Show culture codes link to see a list of culture codes. Locate the desired language and write down the code. This is the code you must use when defining your Language Definition or Text Dictionary Tag entry.

images/howToUseCulture.png
Click the "How to use the browser culture to automatically select the active language" link to open the help.
images/howToUseCulture2.png
The "Show culture codes" link will display a list of culture codes.
images/howToUseCulture3.png
A list of culture codes.

See Also