Skip to content

API reference / @localizer/core / getLocaleChain

Function: getLocaleChain() ​

getLocaleChain(locale): LocaleCode[]

Defined in: fn/locale/get-locale-chain.ts:47

Generates a list of locale codes starting with the given locale, followed by its parent locale (if applicable), and fallback locales.

Caches results for better performance.

Parameters ​

ParameterTypeDescription
localeLocaleCodeThe locale code to generate the chain for.

Returns ​

LocaleCode[]

An array of locale codes.