修复编译错误
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user