Locale Strings
How to interpret locale strings in GT
Overview
General Translation uses a variant of the BCP 47 Language Tag standard to represent locales and languages. BCP 47 Language Tags are the Internet Best Current Practices (BCP) standard for identifying languages in both spoken and written forms. These tags provide a uniform way to specify languages, allowing applications to adapt content, format, and behavior based on the user's locale.
Language tags are composed of one or more subtags separated by the "-"
character. The subtags include the following components:
- Language Subtag: Represents the primary language, e.g.,
en
for English,es
for Spanish. - Region Subtag: Specifies a country or region, e.g.,
US
for the United States,FR
for France. - Script Subtag (optional): Indicates the writing script, e.g.,
Latn
for Latin script. - Variant Subtag (optional): Identifies a specific variation of a language, e.g.,
arevela
for Eastern Armenian.
When you combine these tags together, we refer to this as a Locale or Locale tag.
Commonly Used Tags
In practice, most language tags consist of two subtags: a language and a region. Here are some common examples:
Language Tag | Description |
---|---|
en-US | English as used in the US |
es-ES | Spanish as used in Spain |
fr-CA | French as used in Canada |
zh-CN | Simplified Chinese (China) |
de-DE | German as used in Germany |
Extended Tags
Language tags can include additional subtags for more specificity:
- Example:
hy-Latn-IT-arevela
hy
: Armenian (language)Latn
: Latin (script)IT
: Italy (region)arevela
: Eastern Armenian (variant)
This tag represents Eastern Armenian written in Latin script, as used in Italy.
Exceptions to BCP 47 in GT
🚧 This section is currently under construction. 🚧
Notes
- General Translations uses Locale Tags (Locales) to identify languages and regions internally.
- The format of BCP 47 language tags makes them highly flexible and extensible.
- When designing localized content or systems, understanding and leveraging BCP 47 tags ensures broad compatibility and clarity.
Next Steps
- See our List of Supported Locales to find the language tags available in General Translation.
- For more information about BCP 47 standards, refer to the official IETF Language Tag Registry.