mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
LocalizationUtility 命名规范
This commit is contained in:
@@ -71,8 +71,8 @@ namespace TEngine
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static readonly Dictionary<Language, string> s_LanguageMap = new Dictionary<Language, string>();
|
private static readonly Dictionary<Language, string> _languageMap = new Dictionary<Language, string>();
|
||||||
private static readonly Dictionary<string, Language> s_LanguageStrMap = new Dictionary<string, Language>();
|
private static readonly Dictionary<string, Language> _languageStrMap = new Dictionary<string, Language>();
|
||||||
|
|
||||||
static LocalizationUtility()
|
static LocalizationUtility()
|
||||||
{
|
{
|
||||||
@@ -90,8 +90,8 @@ namespace TEngine
|
|||||||
str = language.ToString();
|
str = language.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
s_LanguageMap[language] = str;
|
_languageMap[language] = str;
|
||||||
s_LanguageStrMap[str] = language;
|
_languageStrMap[str] = language;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -106,7 +106,7 @@ namespace TEngine
|
|||||||
return Language.Unspecified;
|
return Language.Unspecified;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (s_LanguageStrMap.TryGetValue(str, out var language))
|
if (_languageStrMap.TryGetValue(str, out var language))
|
||||||
{
|
{
|
||||||
return language;
|
return language;
|
||||||
}
|
}
|
||||||
@@ -122,7 +122,7 @@ namespace TEngine
|
|||||||
/// <returns>语言字符串。</returns>
|
/// <returns>语言字符串。</returns>
|
||||||
public static string GetLanguageStr(Language language)
|
public static string GetLanguageStr(Language language)
|
||||||
{
|
{
|
||||||
if (s_LanguageMap.TryGetValue(language, out var ret))
|
if (_languageMap.TryGetValue(language, out var ret))
|
||||||
{
|
{
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user