/*private void Update() * { * if (Input.GetKeyDown(KeyCode.Space)) * { * ChangeLanguage(gameLanguage); * } * }*/ void LoadLangageCSVFile(Language.LocalazationLanguage language) { dictionary.Clear(); foreach (string s in csvLanguage) { if (s.Length > 1) { //Debug.Log(s.Length); //Debug.Log(s); string[] line = s.Split(';'); //Debug.Log(line[(int)language]); //Debug.Log("key: " + line[0] + "=" + line[(int)language]); string key = line[0]; string value = line[(int)language]; dictionary.Add(key, value); } //string key = line[0].Trim().Trim(';'); //string value = line[1].Trim().Trim(';'); //dictionary.Add(key, value); //Debug.Log(key + " = " + value); } AutoTranslator[] autos2 = Resources.FindObjectsOfTypeAll <AutoTranslator>(); foreach (AutoTranslator a in autos2) { a.OnLanguageChange(); } //foreach (string k in dictionary.Keys) //Debug.Log(k + " is " + dictionary[k]); }
void ChangeLanguage(Language.LocalazationLanguage language) { gameLanguage = language; languageID = (int)gameLanguage; LoadLangageCSVFile(gameLanguage); AutoTranslator[] autos = Resources.FindObjectsOfTypeAll <AutoTranslator>(); foreach (AutoTranslator a in autos) { a.OnLanguageChange(); } }