API reference / @localizer/core / getPrimaryLocale
Function: getPrimaryLocale()
getPrimaryLocale(
locale):LocaleCode
Defined in: fn/locale/get-primary-locale.ts:31
Returns the primary locale for a given locale code.
If the locale includes a country, it maps to the primary locale for that country using primaryLocales. Otherwise, the original locale is returned.
Parameters
| Parameter | Type | Description |
|---|---|---|
locale | LocaleCode | The locale code to process. |
Returns
The primary locale or the original locale if no mapping exists.