-
Notifications
You must be signed in to change notification settings - Fork 19
Localizing Components
[DEPRECATED] Please refer to new documentation
Localized assets must be attached to the actual game objects in the scene in order to set localized value to the appropriate component's attribute. The package offers various ready-to-use components.
Localizing a Text
-
When the Text game object selected, click
Add Component
button in the inspector. -
Search for
LocalizedTextBehaviour
and add it. -
LocalizedTextBehaviour
needs a component and it's property to set localized value to the property. -
Drag the
Text
component from the game object to theLocalizedTextBehaviour
'sComponent
field. -
The localization system search for the text (
string
) based properties.Property
dropdown lists available properties. Simply selecttext
property. -
Finally, select localized asset from the
Localized Asset
field.
When the game starts, the localization sets the text
property of the selected component with selected localized asset's value. Updates the value whenever game language has changed.
This generic component & property selection provides us to use at any component that has text based property. For example; we can use same behaviour with same steps for the Text Mesh Pro component. You should follow the similar steps for all localized asset types. For instance; attach LocalizedSpriteBehaviour
for the Image component and select sprite property and done!
If you want to go further and create your custom localization behaviour, see here.