Function: selectStarterPacksForLanguage()
selectStarterPacksForLanguage(
packs,locale):StarterPack[]
Defined in: Data/Core/StarterPackTypes.ts:343
Pick the packs offered for a UI locale, best match first.
Matching is two-tier so that a user on es-MX still sees a pack tagged
plain es, and a user on zh-Hans is not offered a zh-Hant pack:
- Exact tag match (case-insensitive) —
es-MX↔es-MX. - Primary-subtag match where neither side declares a conflicting
script —
es-MX↔es. A tag carrying a script subtag (zh-Hans) only falls back to another tag with the same script, because Simplified and Traditional Chinese are not interchangeable content.
Returns [] when nothing matches, which is a normal outcome the first-run
UI must handle — see the hi note on SUPPORTED_CONTENT_LANGUAGES.
Parameters
packs
readonly StarterPack[]
locale
string