fix: 调整Character语言回退逻辑

This commit is contained in:
2026-07-31 23:13:56 +08:00
parent 48dcc9ec3a
commit 24c5169a10
3 changed files with 28 additions and 11 deletions
+11 -7
View File
@@ -76,6 +76,11 @@ namespace AibisDream.Kit
rawName = GetLocalizedNameByKind(LocalizationKit.CurrentLocaleKind);
}
if (string.IsNullOrWhiteSpace(rawName))
{
return string.Empty;
}
return string.IsNullOrEmpty(nameColor) ? rawName : $"<color={nameColor}>{rawName}</color>";
}
@@ -84,19 +89,18 @@ namespace AibisDream.Kit
switch (kind)
{
case LocaleKind.En:
return string.IsNullOrWhiteSpace(en) ? key : en;
return en;
case LocaleKind.Ja:
if (!string.IsNullOrWhiteSpace(ja)) return ja;
return string.IsNullOrWhiteSpace(cn) ? key : cn;
return ja;
case LocaleKind.Ru:
return string.IsNullOrWhiteSpace(ru) ? key : ru;
return ru;
case LocaleKind.Es:
return string.IsNullOrWhiteSpace(es) ? key : es;
return es;
case LocaleKind.PtBr:
return string.IsNullOrWhiteSpace(ptBr) ? key : ptBr;
return ptBr;
case LocaleKind.Cn:
default:
return string.IsNullOrWhiteSpace(cn) ? key : cn;
return cn;
}
}
+5
View File
@@ -134,6 +134,11 @@ namespace AibisDream.Utility
{
key = charKey,
cn = charKey,
en = charKey,
ja = charKey,
ru = charKey,
es = charKey,
ptBr = charKey,
role = ActorRole.Aside
};
}