So, I’d like to list the languages available, each with its own (localized) name, for selection. A simple way to do this seems to be to create an entry named something like “languageName” which is localized. I know I can iterate over the available languages by using LocalizationSettings.AvailableLocales, but how do I retrieve a localized string for a specific (not the current) locale?
One of the samples shows how to display the English name combined with the localized name for that Locale. Is that what you want or do you want a localized name for the currently selected Locale?
For that you would need to have a table with an entry for each Locale and then do a lookup.
You can get a localized string for a specific Locale by either settings the LocaleOverride when using a LocalizedString or by passing in a Locale into GetLocalizedString.
Yeah, I want to have localizers define the localized name and then do a lookup. I was looking exactly for the GetLocalizedString method that you mentioned. So, that solves the problem, thank you! (I somehow expected that there’d be a constructor for LocalizedString which takes a locale, but that might not be the best of ideas).
Thanks also for reminding me about the samples, I completely forgot that they exist. May I humbly suggest to add a top-level entry to the localization documentation on About Localization | Localization | 1.0.5 about these samples? I for one would benefit from that reminder in the future…