Hi Karl!
First of all, congrats for the development of this plugin.
This is a very useful tool for translation of a game in an efficient way.
I have a doubt. I have an application that has only one string table. When the app starts, I initialize the Localization Settings and then, I initialize the table in an Async Way.
Then, I store the table in a class property.
StringTable table;
IEnumerator Start()
{
yield return LocalizationSettings.InitializationOperation;
LocalizationSettings.SelectedLocaleChanged += changedLocale;
var tableOp = LocalizationSettings.StringDatabase.GetTableAsync("StringCollection");
yield return tableOp;
print("Initialized StringCollectionTable");
table = tableOp.Result;
}
Then, when I get a string, I use the wrapper method
public string getString(string code){
return table.GetEntry(code)?.GetLocalizedString()??$"[[{code}]]";
}
And I created a method that change the locale
public void setSelectedLocale(Locale locale){
LocalizationSettings.SelectedLocale = locale;
}
Now, I’m testing the method in a button, but always returns the text in the default language.
Manager.localization.setSelectedLocale(locales.First(x=>x.name == "English (en)"));
print(Manager.localization.getSelectedLocale());
print(Manager.localization.getString("Build"));
Am i to refresh the table after change the locale? ¿Are there other more efficient way to get the translated string?
Thanks!!