3 using System.Collections.Generic;
16 get {
return _localizedStrings.Keys.ToArray(); }
19 static Dictionary<SystemLanguage, Dictionary<string, string>> _localizedStrings;
23 _localizedStrings =
new Dictionary<SystemLanguage,Dictionary<string,string>>();
25 foreach (var language
in Enum.GetValues(typeof(SystemLanguage)))
27 var localizedStringsByLanguage =
new Dictionary<string, string>();
31 foreach (var stringsAsset
in Resources.LoadAll<TextAsset>(
32 "Localization/" + language +
"/Strings"))
34 var stringsJeli =
UJeli.Parse(stringsAsset.text);
36 foreach (var stringJeli
in stringsJeli.Children)
38 localizedStringsByLanguage[stringJeli.Name] = stringJeli.Value.Replace(
"\\n",
"\n");
42 _localizedStrings.Add((SystemLanguage)language, localizedStringsByLanguage);
55 public static string GetString (
string key, SystemLanguage language = SystemLanguage.Unknown)
57 if (language == SystemLanguage.Unknown)
60 Dictionary<string, string> localizedLanguage = null;
62 if (!_localizedStrings.TryGetValue(language, out localizedLanguage))
65 string localizedString = null;
67 if (!localizedLanguage.TryGetValue(key, out localizedString))
70 return localizedString;
static string GetString(string key, SystemLanguage language=SystemLanguage.Unknown)
Gets the localized string for the given string key.
static SystemLanguage[] AvailableLanguages
Gets an array of available languages for this game.
ClientConfig Config
Gets the configuration for this client.
static GameClient Instance
Gets the sole instance of the game client.
Unity version of Jeli markup class.