Skip to content

Formats and Standards

Alice Zoë Bevan–McGregor edited this page Apr 28, 2016 · 3 revisions

The WebCore GILT support library makes use of a number of industry standards.

Language Tags

User preference as to desired language, region, timezone, currency, and any region format customizations are encoded either as an IETF BCP-47 Language Tag with Unicode Extensions or in a basic compound type (JSON object, Python dictionary, etc.) with the language tag fields split apart and named. It is only recommended to use the split form for storage in situations where querying on individual fields is required, otherwise storage is as simple as a single string.

The following features will be / are supported:

  • Primary Language (en, fr, etc.)
  • Region Subtag (en-US, en-CA, etc.)
  • Unicode Locale Extension
    • Calendar (gregorian, hebrew, etc.)
    • Currency Format Style (standard, use a negative sign, or account, wrap in parenthesis)
    • Numeric System (latn, arab, roman, thai, etc.) defaulting to the region default.
    • Measurement System (metric, uksystem, ussystem) defaulting to the region default.
    • Hour Cycle (h12, h24) defaulting to the region default.
    • Currency (CAD, USD, etc.) defaulting to region primary currency if possible.
    • Timezone — use a reference document for these.

Example language tags might include:

  • en — English text, region unspecified.
  • en-US — English as spoken in the USA.
  • fr-CA-u-cu-USD-tz-cator — French (Québecois) Canadian with currency values in USD in the "Canada/Eastern" timezone.
  • ar-u-nu-latn — Arabic language content, region unspecified, using Latin numbers.
  • he-IL-u-ca-hebrew-tz-jeruslm — Hebrew as spoken in Israel using the Hebrew calendar and "Asia/Jerusalem" timezone.

Matching a user's language preference list against the available languages is performed using CLDR Version 28 Language Matching. This ratifies exactly how to handle mismatches between supported and desired languages. See the Unicode Consortium page for details on this process, or the Unicode Locale Data for the complete set of allowed values.

See also:

Clone this wiki locally