void UpdateL10n() { if (GetComponent <Text>() != null) { GetComponent <Text>().text = LanguageSO.GetText(key); } else if (GetComponent <Button>() != null) { GetComponentInChildren <Text>().text = LanguageSO.GetText(key); } }
public static string GetText(string key) { LanguageSO db = Database; if (db != null) { foreach (KeyValueStore kv in db.entries) { if (kv.key == key) { return(kv.value); } } } return(string.Empty); }
public static void LoadDatabase(string language) { activeDatabase = Resources.Load <LanguageSO>(language); updateEvent.Invoke(); }