Locale
Represents a BCP 47 locale combining language and country for internationalization. Defines regional formatting conventions for dates, numbers, text direction, and calendar preferences.
Properties
| Property | Type | Mode | Description | Required |
|---|---|---|---|---|
| code | string | stored | BCP 47 language tag (e.g., 'en-US', 'fr-FR', 'es-MX', 'zh-Hans-CN') Example: | Required |
| displayName | string | stored | Human-readable display name for the locale Example: | Required |
| nativeName | string | stored | Display name in the locale's own language Example: | Optional |
| language | Language | stored | Reference to the base Language for this locale | Required |
| country | Country | stored | Reference to the Country for regional variants (null for language-only locales) | Optional |
| textDirection | string | stored | Text reading direction Values: Example: | Required |
| dateFormatPattern | string | stored | Common date format pattern for this locale Example: | Optional |
| timeFormatPattern | string | stored | Common time format pattern for this locale Example: | Optional |
| decimalSeparator | string | stored | Decimal separator character Example: | Optional |
| thousandsSeparator | string | stored | Thousands separator character Example: | Optional |
| firstDayOfWeek | string | stored | First day of the week for this locale Values: Example: | 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"
}