Skip to content

Commit 37fcb08

Browse files
committed
fix(ey): 🎨 修复 ey 对 zh-TW 和 ja-JP 语言的感知
1 parent 082e83e commit 37fcb08

1 file changed

Lines changed: 16 additions & 15 deletions

File tree

  • packages/guard-core-v4/src/_utils/locales

packages/guard-core-v4/src/_utils/locales/index.ts

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export const fallbackLng = (code = '') => {
3737

3838
if (!code || code === 'zh') return ['zh-CN']
3939

40-
if (!code || code === 'ja') return ['ja-JP']
40+
// if (!code || code === 'ja') return ['ja-JP']
4141

4242
const fallbacks = []
4343

@@ -46,22 +46,23 @@ export const fallbackLng = (code = '') => {
4646
return fallbacks
4747
}
4848

49-
if (code.startsWith('ja-')) {
50-
fallbacks.push('ja-JP')
51-
return fallbacks
52-
}
49+
// if (code.startsWith('ja-')) {
50+
// fallbacks.push('ja-JP')
51+
// return fallbacks
52+
// }
5353

5454
if (code.startsWith('zh-')) {
55-
if (
56-
['zh-tw', 'zh-hk', 'zh-mo', 'zh-hant'].includes(code.toLocaleLowerCase())
57-
) {
58-
fallbacks.push('zh-TW')
59-
} else if (['zh-cn', 'zh-sg', 'zh-my'].includes(code.toLocaleLowerCase())) {
60-
fallbacks.push('zh-CN')
61-
} else {
62-
fallbacks.push('zh-CN')
63-
}
64-
55+
// if (
56+
// ['zh-tw', 'zh-hk', 'zh-mo', 'zh-hant'].includes(code.toLocaleLowerCase())
57+
// ) {
58+
// fallbacks.push('zh-TW')
59+
// } else
60+
// if (['zh-cn', 'zh-sg', 'zh-my'].includes(code.toLocaleLowerCase())) {
61+
// fallbacks.push('zh-CN')
62+
// } else {
63+
// fallbacks.push('zh-CN')
64+
// }
65+
fallbacks.push('zh-CN')
6566
return fallbacks
6667
}
6768

0 commit comments

Comments
 (0)