Repository navigation
Commit b39730e
committed
test(i18n): add runnable locale-detection unit tests
Export matchTag and factor the detectLang choice into a pure, global-free
pickLang(saved, prefs) so the BCP-47 → supported-language mapping is unit
testable. Add vitest and cover the tricky cases: zh-Hant-HK/zh-MO → zh-TW,
pt-PT → pt-BR, region tags → primary language, unsupported → null, saved
choice precedence, first-supported-preference, and English fallback.1 parent bed3966 commit b39730e
4 files changed
Lines changed: 481 additions & 12 deletions
0 commit comments