Working with Unity Localization approach
Posted: 18 Jul 2024, 13:05
Hi,
We are working on the localization system for our project and we are using Unity Localization since we want to use the smart translations that it provides.
We've been able to bind the views and refresh texts when the language changes by creating a Dictionary<string,localizedString> that implements the propertyChanged and subscribes to the localizedString .StringChanged event and returns the value of the localizedString with GetLocalizedString().
We bind the text in the views to the dictionary using the keys in the dictionary like this:
My questions are:
Do you advise a different aproach when working with Unity Localization? Can you give some examples?
Do you know if is it possible to bind directly to the keys that exists in the Localization tables?
For example, if i've got the LOGIN_BUTON_TEXT key in unity localization table which I suppose it's linked somehow to its LocalizedString, can we access that key to save it in our dictionary? the keys we are using are created by us and that means that we need to add an extra layer for binding our keys to the LocalizedString.
Thanks for your help!
We are working on the localization system for our project and we are using Unity Localization since we want to use the smart translations that it provides.
We've been able to bind the views and refresh texts when the language changes by creating a Dictionary<string,localizedString> that implements the propertyChanged and subscribes to the localizedString .StringChanged event and returns the value of the localizedString with GetLocalizedString().
We bind the text in the views to the dictionary using the keys in the dictionary like this:
Code: Select all
<Button Content="{Binding myDictionary[MyCustomStringKey]}"/>Do you advise a different aproach when working with Unity Localization? Can you give some examples?
Do you know if is it possible to bind directly to the keys that exists in the Localization tables?
For example, if i've got the LOGIN_BUTON_TEXT key in unity localization table which I suppose it's linked somehow to its LocalizedString, can we access that key to save it in our dictionary? the keys we are using are created by us and that means that we need to add an extra layer for binding our keys to the LocalizedString.
Thanks for your help!