Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2195946

Browse files
authored
feat: useIntl.getCanonicalLocales check locale (#450)
1 parent1563eb9 commit2195946

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

‎utils/getLanguage.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,13 @@ interface Language {
5252
*/
5353
functionlinkLocale(locale:string){
5454
letlinkedLocale:string
55-
switch(locale){
55+
try{
56+
//@ts-ignore
57+
linkedLocale=Intl.getCanonicalLocales(locale)[0]
58+
}catch(error){
59+
console.log(`${error.toString()}\n`)
60+
}
61+
switch(linkedLocale){
5662
case'zh-TW':
5763
case'zh-HK':
5864
case'zh-MO':

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp