public static void LoadLanguage(string languageCode) { Editor.InitSystem(String.Format("Localisation ({0})", languageCode), () => { BoxEd = LocaleDictionary.Load(Resources.Load("Editor") as TextAsset, languageCode); return(BoxEd != null); }); }
public static LocaleDictionary Load(string xmlString, string languageCode) { var dictionary = new LocaleDictionary(); var document = new XmlDocument(); document.LoadXml(xmlString); foreach (var phrase in document.FirstChild.ChildNodes.OfType <XmlElement>().Where(phrase => phrase.HasAttribute(languageCode))) { dictionary.Add(phrase.GetAttribute("en"), phrase.GetAttribute(languageCode)); } return(dictionary); }