UI toolkit and localization

I’m using UI Toolkit in my games I want to localize everything. I’m following the official localization package manual but I have no option to add a binding type other than “Default”.9713392--1388128--upload_2024-3-20_21-5-52.png

I’ve updated the localization package 1.5.1 by writing com.unity.localization as a Git URL (otherwise, it wouldn’t let me update past 1.4.5). I’ve also tried updating my UI Toolkit package by writing com.unity.ui as a Git URL (2.0.0). Still, there are no options.

I’ve tried manually writing the UXML, but I get an error saying that it’s unsupported syntax.

<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" editor-extension-mode="False" xmlns:l="UnityEngine.Localization">
    <Style src="project://database/Assets/UI/Styles.uss?fileID=7433441132597879392&guid=e49b921c68366b44d94ca8c7b4b3d471&type=3#Styles" />
    <ui:VisualElement name="Background" class="background" style="flex-grow: 1; width: 400px; justify-content: center;">
        <ui:Button text="Play" name="Play" class="button">
            <Bindings>
                <l:LocalizedString property="text" table="LocalizedStrings" entry="Play" />
            </Bindings>
        </ui:Button>
        <ui:Button text="Settings" name="Settings" class="button" />
        <ui:Button text="Exit" name="Exit" class="button" />
    </ui:VisualElement>
</ui:UXML>

I’ve tried restarting Unity.

What did I do wrong?

What version of Unity are you using?
It requires 2023.3/Unity 6

Ah, my bad. I’m on 2023.2.

1 Like