修复编译错误

This commit is contained in:
2026-05-12 21:50:49 +08:00
parent 2b2a74da42
commit 458f344e83
28 changed files with 122 additions and 54 deletions

View File

@@ -84,10 +84,10 @@ namespace BaseGames.Localization
}
/// <summary>
/// 获取本地化字符串(实例方法)。
/// 获取本地化字符串(显式接口实现)。
/// 查找顺序:当前语言 → 回退语言English→ 直接返回 key。
/// </summary>
public string Get(string key, string table = "UI")
string ILocalizationService.Get(string key, string table)
{
if (string.IsNullOrEmpty(key)) return string.Empty;
@@ -134,7 +134,9 @@ namespace BaseGames.Localization
dict = LoadTable(language, table);
_cache[cacheKey] = dict; // 即使加载失败也存入空字典,避免每帧重试
}
return dict != null && dict.TryGetValue(key, out value);
if (dict != null && dict.TryGetValue(key, out value)) return true;
value = null;
return false;
}
/// <summary>