Get started with localization
Set up localization in a project and translate your first string.
Read time 2 minutesLast updated 6 days ago
Set up localization in a project and translate your first string.
Follow these steps once to create the settings, add languages, author a translation, and preview the result in the Unity Editor.
Create the Localization settings
To create the settings asset:
- Open Edit > and select Localization.Project Settings
?
- Select Create localization settings and select where to save the asset.
The settings asset holds your locales, startup behavior, and content sources. Unity loads it automatically in the Editor and in builds. For details, refer to Localization settings reference.
Add locales
A locale describes a language and region, such as English or French (Canada). To add the languages you want to support:
- In Project Settings > Localization, select Add locale.
- In the Add locales window, search for each language you want to support and add it.
- Set the Project locale to the language you author in. The project locale is the default when no other selection applies.
For information about fallback locales, startup locale selection, and disabling locales, refer to Locales.
Create a table collection
A table collection stores one value per locale for each key. To create a table collection:
- Select Assets > Create > Localization > Resource Table Collection, and select where to save the collection and its per-locale tables.
- Open Window > Localization > Resource Tables and select the collection.
- Add a key, for example , with the entry type String, and enter a value for each locale column.
greeting
For entry types, Smart Strings, and variants, refer to Localization tables.
Use the localized string
Then, reference the entry. How you reference it depends on where you need the localized value:
- In UI Toolkit, bind a Label's text to the entry. Refer to Localize UI created with UI Toolkit.
- On a GameObject, add a Localize String Event component and wire its event to your text component. Refer to Localize strings.
- In a script, add a field and subscribe to its
LocalizedStringevent. Refer to Display dynamic values in a localized string.StringChanged
Preview another language
The Editor's main toolbar has a preview locale dropdown. To show or hide it, right-click (macOS: Ctrl+click) the toolbar. Changing the dropdown changes the selected locale, and localized values update to match.