UI Toolkit Tablet Localisation¶
Overview¶
The Tablet uses the Unity Localisation Package and a String based table. This can be exported and imported as a CSV for ease of translation and use across the team.
It is split between two systems since there is the localisation binding on UI Toolkit Text strings and binding on the 3D Text Mesh Pro strings.
Official Documentation:
Localisation Table Editing¶
To open the Localisation Table you go:
Window -> Asset Management -> Localization Tables
They are stuctured like a regular database where you have the key reference then the corresponding string in each loaded language.
Importing and Exporting is done in the top right.
UI Builder Localisation Binding¶
To bind localised strings to the UI Toolkit Text Elements, you can do so inside of UI Builder.
The steps are:
-
Select the text element you want to bind in the hierarchy
-
In the inspector on the right go to
Attributes -> Text -
Right click on the text box and selected
Add Binding -
In the pop up select the type drop down and choose
UnityEngine.Localization -> Localized String -
In Localized String click
Select Entryand select the desired key from the table.
UGUI Localisation Binding¶
To bind localised strings to the 3D Text Elements, you need to add a Localize String Event component. I have added this in the parent of all the prefabs. If the element is just an icon you can disable this component to prevent any errors.
The steps are:
-
In Update String add a new element
-
Reference the TMP_Text object in the field
-
In the dropdown select
TextMeshPro.Text -
Select the table key in the String Reference drop down above it