Fix toLangName

This commit is contained in:
kwaroran
2024-09-24 08:54:18 +09:00
parent ca9928fd2b
commit 71d575ebfe

View File

@@ -471,6 +471,7 @@ export function parseMultilangString(data:string){
}
export const toLangName = (code:string) => {
try {
switch(code){
case 'xx':{ //Special case for unknown language
return 'Unknown Language'
@@ -479,6 +480,9 @@ export const toLangName = (code:string) => {
return new Intl.DisplayNames([code, 'en'], {type: 'language'}).of(code)
}
}
} catch (error) {
return code
}
}
export const capitalize = (s:string) => {