Skip to content

Localizing Components

H. Ibrahim Penekli edited this page Nov 24, 2018 · 5 revisions

[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.

    Add component
  • LocalizedTextBehaviour needs a component and it's property to set localized value to the property.

  • Drag the Text component from the game object to the LocalizedTextBehaviour's Component field.

    Attach component
  • The localization system search for the text (string) based properties. Property dropdown lists available properties. Simply select text property.

    Select property
  • Finally, select localized asset from the Localized Asset field.

    Select asset

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.