Remap zh-TW to zh-Hant to match Traditional Chinese in other regions

This commit is contained in:
Jamie Kyle 2023-05-04 16:50:14 -07:00 committed by Josh Perez
parent 593ae82c7f
commit ed539c31b8
4 changed files with 12 additions and 3 deletions

View file

@ -44,6 +44,13 @@ function rename(from: string, to: string) {
// "zh-YU" actually implies "Chinese as spoken in Yugoslavia (canonicalized to Serbia)"
rename('zh-YU', 'yue');
// For most of the Chinese-speaking world, where we don't have a region specific
// locale available (e.g. zh-HK), zh-TW is a suitable choice for "Traditional Chinese".
//
// However, Intl.LocaleMatcher won't match "zh-Hant-XX" to "zh-TW",
// we need to rename it to "zh-Hant" explicitly to make it work.
rename('zh-TW', 'zh-Hant');
console.log('Formatting newly-downloaded strings!');
console.log();
execSync('yarn format', {