A "locale" is a specific variation of a language
Loco supports languages with or without additional information, but the term "locale" is used across the site even when it refers to just a base language (e.g. English).
Regions and variants
A languages may be spoken or written quite differently across geographical locations. For example, adding Portuguese to your project may not be specific enough. You'll most likely want to differentiate between European and Brazilian Portuguese by specifying the region.
Some languages have different dialects or might just differ slightly within the same country. For example, English spoken in Scotland is the same language that's spoken in the rest of the United Kingdom, but if you need to be more specific you can specify a variant.
Writing systems
All languages have a default writing system, and most commonly only one. English is normally written in the Latin script.
Languages commonly written in multiple scripts may require multiple locales for translation. A common example is Traditional and Simplified Chinese. Although these variations may be more common in certain regions, this is a separate way to differentiate the locales without specifying location.
Locale codes
Loco expresses locales with a short code, but unless you're a developer you won't have to interact with these codes very much, or even at all. These codes are sometimes called language tags. It's worth knowing something about them if you're working with developers.
From our examples above:
- Portuguese is
"pt"
, but adding a region could make it either"pt-PT"
for Portugal or"pt-BR"
for Brazil. - British English is
"en-GB"
, but a Scottish variant could be"en-GB-scotland"
or just"en-scotland"
. - Traditional and Simplified Chinese are
zh-Hant
andzh-Hans
respectively.
Note that the suffixes in these three examples (BR
, scotland
and Hant
) refer to separate properties (region, variant, and script).