Skip to content

matchLocale

matchLocale(tag, available): string | null

Defined in: i18n/Localization.ts:145

Pick the best available locale for a platform tag: exact match first, else the first locale sharing the primary language (‘zh-Hans-CN’ → ‘zh-CN’), else null — the caller keeps its current locale. Pure.

string

readonly string[]

string | null