GlossaryLocalization

Locale

A locale is a language plus the regional conventions that go with it, written as a tag such as de or de-AT. How locales differ from languages and how tags work.

Published
Reading time
2 min read
A monk and a trekker climb stone steps to a cliffside monastery whose great door is decorated with green and orange leaf tiles.
On this page
  1. Locale vs language
  2. How a locale is written
  3. How LangRelay identifies a Target locale

A locale is a language together with the place-specific conventions a reader expects: spelling, vocabulary, date and number formats, currency. "German" is a language. German as written in Austria, where January is Jänner, is a locale. Software and websites use locales because the language alone does not tell them how to write a date or which word to use.

Locale vs language#

Every locale has a language, but one language can have many locales. Spanish is one language; Spanish for Spain, for Mexico and for Argentina are three locales with different words and, in Argentina, a different informal pronoun. Their number formats differ too: the browser's locale data writes 12.345,6 for Spain and Argentina and 12,345.6 for Mexico. A locale can also carry a script, which is how Chinese in Traditional characters is told apart from Chinese in Simplified ones.

The distinction matters when one version of a page has to serve many countries. A site with a single French version uses a language. A site with separate pages for France and Quebec, each with its own prices and vocabulary, uses locales.

How a locale is written#

On the web, a locale is written as a BCP 47 language tag, defined in RFC 5646. The tag starts with a language subtag and can add a script and a region:

  • fr is French, with no region.
  • de-AT is German as used in Austria.
  • zh-Hant is Chinese written in the Traditional script.
  • es-419 is Spanish for Latin America and the Caribbean, using a UN region number.

Tags are not case sensitive, but the convention is a lowercase language and an uppercase region. Other systems write the same idea differently: WordPress names its translation files with locales such as de_DE, with an underscore. Search engines are stricter than the standard. Google's hreflang accepts ISO 639-1 language codes and ISO 3166-1 two-letter regions only, so es-419 is a valid tag that Google's hreflang does not support.

How LangRelay identifies a Target locale#

In LangRelay, each language you translate a Site into is a Target locale, and its only identity is a canonical BCP 47 tag from a curated list. Everything else is derived from that tag and cannot be edited separately:

  • The URL prefix is the tag in lower case: /de/, or /de-at/ for a regional locale.
  • The hreflang value and the page's html lang are the tag itself.
  • The variety the translation engine is asked for comes from the tag.

A bare tag means its Unicode CLDR default content locale. Bare de is German as written in Germany, bare pt is Brazilian Portuguese and bare en is American English. A regional tag is a Target locale of its own, with its own translations and approvals, and it can sit beside the bare tag, which then serves every reader of that language without a closer match. Today a Site chooses from eight bare languages. Regional variants such as de-AT are on the roadmap.

Formality is not part of the locale. Whether German pages say Sie or du is a setting on the de Target locale, because no tag can express it and hreflang would have no way to tell two registers apart. The Spanish website translation guide shows tags and register together for one language.

For how locales fit into a wider project, see localization vs translation and the website localization guide.

Sources

The pages this one cites, with the day each was read.

  1. 01MDN Web Docs, Intl.NumberFormatdeveloper.mozilla.org, checked 7 October 2026
  2. 02RFC 5646, Tags for Identifying Languagesrfc-editor.org, checked 7 October 2026
  3. 03WordPress Developer Resources, Localizationdeveloper.wordpress.org, checked 7 October 2026
  4. 04Google Search Central, Tell Google about localized versions of your pagedevelopers.google.com, checked 7 October 2026
  5. 05Wikipedia, Austrian Germanen.wikipedia.org, checked 7 October 2026
  6. 06Wikipedia, Spanish pronounsen.wikipedia.org, checked 7 October 2026
  • hreflang
  • locales
  • localization
  • Glossary

    Neural machine translation

    Neural machine translation uses a neural network to translate whole sentences: encoder and decoder, attention, the Transformer, and how LLMs relate to it.

Part of a guide

Book a demo

See LangRelay on your own site

Book 30 minutes with the team. We translate one of your pages live and walk through review, publishing and multilingual SEO.