fix: 处理 i18n 的一些特殊 case

This commit is contained in:
MistEO
2022-07-25 22:19:04 +08:00
parent f66a69d727
commit 84991f14bd

View File

@@ -33,15 +33,15 @@ namespace MeoAsstGui
{
return local;
}
if (local.StartsWith("zh"))
foreach (var lang in SupportedLanguages)
{
return "zh-cn";
}
else
{
return "en-us";
var key = lang.Key.Contains("-") ? lang.Key.Split('-')[0] : lang.Key;
if (local.StartsWith(key) || key.StartsWith(local))
{
return lang.Key;
}
}
return "en-us";
}
}