Locale

Represents a BCP 47 locale combining language and country for internationalization. Defines regional formatting conventions for dates, numbers, text direction, and calendar preferences.

11 properties
Schema

Properties

PropertyTypeModeDescriptionRequired
codestring
stored

BCP 47 language tag (e.g., 'en-US', 'fr-FR', 'es-MX', 'zh-Hans-CN')

Example: "en-US"

Required
displayNamestring
stored

Human-readable display name for the locale

Example: "English (United States)"

Required
nativeNamestring
stored

Display name in the locale's own language

Example: "English (United States)"

Optional
languageLanguage
stored

Reference to the base Language for this locale

Required
countryCountry
stored

Reference to the Country for regional variants (null for language-only locales)

Optional
textDirectionstring
stored

Text reading direction

Values: ltr, rtl

Example: "ltr"

Required
dateFormatPatternstring
stored

Common date format pattern for this locale

Example: "MM/DD/YYYY"

Optional
timeFormatPatternstring
stored

Common time format pattern for this locale

Example: "12h"

Optional
decimalSeparatorstring
stored

Decimal separator character

Example: "."

Optional
thousandsSeparatorstring
stored

Thousands separator character

Example: ","

Optional
firstDayOfWeekstring
stored

First day of the week for this locale

Values: sunday, monday

Example: "sunday"

Optional

Examples

Example 1

{
  "@type": "Locale",
  "code": "en-US",
  "displayName": "English (United States)",
  "nativeName": "English (United States)",
  "language": {
    "@type": "Language",
    "code": "en",
    "name": "English"
  },
  "country": {
    "@type": "Country",
    "code": "US",
    "name": "United States"
  },
  "textDirection": "ltr",
  "dateFormatPattern": "MM/DD/YYYY",
  "timeFormatPattern": "12h",
  "decimalSeparator": ".",
  "thousandsSeparator": ",",
  "firstDayOfWeek": "sunday"
}

Example 2

{
  "@type": "Locale",
  "code": "fr-FR",
  "displayName": "French (France)",
  "nativeName": "Français (France)",
  "language": {
    "@type": "Language",
    "code": "fr",
    "name": "French"
  },
  "country": {
    "@type": "Country",
    "code": "FR",
    "name": "France"
  },
  "textDirection": "ltr",
  "dateFormatPattern": "DD/MM/YYYY",
  "timeFormatPattern": "24h",
  "decimalSeparator": ",",
  "thousandsSeparator": " ",
  "firstDayOfWeek": "monday"
}

Example 3

{
  "@type": "Locale",
  "code": "ar-SA",
  "displayName": "Arabic (Saudi Arabia)",
  "nativeName": "العربية (المملكة العربية السعودية)",
  "language": {
    "@type": "Language",
    "code": "ar",
    "name": "Arabic"
  },
  "country": {
    "@type": "Country",
    "code": "SA",
    "name": "Saudi Arabia"
  },
  "textDirection": "rtl",
  "dateFormatPattern": "DD/MM/YYYY",
  "timeFormatPattern": "12h",
  "decimalSeparator": ".",
  "thousandsSeparator": ",",
  "firstDayOfWeek": "sunday"
}

Example 4

{
  "@type": "Locale",
  "code": "de-DE",
  "displayName": "German (Germany)",
  "nativeName": "Deutsch (Deutschland)",
  "language": {
    "@type": "Language",
    "code": "de",
    "name": "German"
  },
  "country": {
    "@type": "Country",
    "code": "DE",
    "name": "Germany"
  },
  "textDirection": "ltr",
  "dateFormatPattern": "DD.MM.YYYY",
  "timeFormatPattern": "24h",
  "decimalSeparator": ",",
  "thousandsSeparator": ".",
  "firstDayOfWeek": "monday"
}