Hello. I’m trying to dynamically change a localized label in the UI, using the UI Toolkit. I’m using the Unity 6000.0.23f1. I followed the docs page on localization in the UI Toolkit and managed to add a binding of type Localized String. When I select the localized string, such as brothers_turn, in my localization table called main, the label does update with the localized text as expected in the UI Builder window. However, when I start the game and trigger the code below, the label says ‘No translation found’ rather than the expected text.
Here’s what I tried:
currentTurnText = ui.Q<Label>("CurrentTurnText");
var binding = currentTurnText.GetBinding("text") as LocalizedString;
binding.TableReference = "main";
binding.TableEntryReference = "sisters_turn";
binding.RefreshString();
That didn’t work, though. On the docs page, it goes into using variables, but I simply want to change the localization table entry that is applied to the label. How can I change the localized string entry from, say, main/brothers_turn to main/sisters_turn?
It also says ‘Unresolved binding’, which I don’t know how to solve.

Project Settings → Localization
I must be doing something wrong. Any help in figuring out how to do this the proper way would be much appreciated!


