Exemple #1
0
 public static void AddTranslation(LocalizedTextManager.LocalizedText text, string language, string translation)
 {
     if (text._localizedTextDictionary.ContainsKey(language))
     {
         return;
     }
     text._localizedTextDictionary.Add(language, translation);
 }
Exemple #2
0
            public static string GetTranslatedText(string languageId, LocalizedTextManager.LocalizedText localizedText)
            {
                string str;

                if (localizedText._localizedTextDictionary.TryGetValue(languageId, out str))
                {
                    return(str);
                }
                if (localizedText._localizedTextDictionary.TryGetValue("English", out str))
                {
                    return(str);
                }
                return("");
            }
Exemple #3
0
        internal static void Deserilaize(XmlNode node, string languageId)
        {
            if (node.Attributes == null)
            {
                throw new Exception("Node attributes are null!");
            }
            string value = node.Attributes["id"].Value;
            string str   = node.Attributes["text"].Value;

            if (!LocalizedTextManager._gameTextDictionary.ContainsKey(value))
            {
                LocalizedTextManager.LocalizedText localizedText = new LocalizedTextManager.LocalizedText();
                LocalizedTextManager._gameTextDictionary.Add(value, localizedText);
            }
            LocalizedTextManager.LocalizedText.AddTranslation(LocalizedTextManager._gameTextDictionary[value], languageId, str);
        }