Skip to content

Commit b39730e

Browse files
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

File tree

0 commit comments

Comments
 (0)