Locale

The Locale element specifies the locales, or regional language types, supported within your gadget. There may be many Locale nodes within a single gadget if it supports many international countries and languages.

Locale may take the following form:

<ModulePrefs>
    <Locale lang="en" country="us" />
</ModulePrefs>

In addition to basic locale identifiers, a number of attributes may be tied in with a Locale node, as shown in Table 3-4.

Table 3-4. Locale attributes

Attribute

Description

country

The country associated with the locale supported. Countries are specified as two-digit codes based on ISO 3166-1 standards; for more details, see http://en.wikipedia.org/wiki/ISO_3166-1.

lang

The language associated with the locale. This is an optional field, but one of either country or lang must be present in a Locale node. Languages are specified as Alpha-2 codes based on ISO 639-1 standards; for more details, see http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes.

language_direction

The text-reading direction that the language dictates. The values for this field can be either ltr (left to right) or rtl (right to left). This is an optional field with a default value of ltr. For multidirection support, there are several substitution variables you can use with rtl or ltf:

__BIDI_START_EDGE__

If the gadget is in left-to-right mode, the value is left; if it’s in right-to-left mode, the value is right.

__BIDI_END_EDGE__

If the gadget is in left-to-right mode, the value is right; if it’s in right-to-left ...

Get Programming Social Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.