fix: unify chinese language code as zh-CN
This commit is contained in:
@@ -34,8 +34,10 @@ export function resourceLanguageLabel(
|
||||
): string {
|
||||
const lc = langCode.trim().toLowerCase();
|
||||
const normalized =
|
||||
lc === "zh-cn" || lc === "zh-tw" || lc === "zh-hans" ? "zh" : lc;
|
||||
const key = `lang_${normalized}`;
|
||||
lc === "zh" || lc === "zh-cn" || lc === "zh-tw" || lc === "zh-hans"
|
||||
? "zh-CN"
|
||||
: lc;
|
||||
const key = `lang_${normalized.replace("-", "_")}`;
|
||||
const label = t(key);
|
||||
return label !== key ? label : langCode.trim();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user