Translating your game can multiply its audience. On Steam, English speakers are well under half of all players. But retrofitting translations into a game full of hard-coded strings is painful. Unity’s official Localization package handles the hard parts: string tables, per-language assets, switching language at runtime, plurals and variables in text. This tutorial sets it up from scratch in Unity 6, localizes UI text and images, drives it from code, adds a language menu, and covers fonts for languages like Japanese and Chinese.
Installing and Creating Locales
- Install Localization from Window > Package Manager > Unity Registry. It also installs Addressables, which it uses to load tables.
- Open Edit > Project Settings > Localization and click Create to make a Localization Settings asset.
- Click Locale Generator, tick the languages you want (English, French, German, Japanese…) and click Generate Locales. Save them in a folder like
Assets/Localization/Locales. - Under Locale Selectors, check the order Unity uses to pick a starting language. The defaults try the command line, then the player’s system language, then a Specific Locale. Set that one to your main language as the fallback.
String Tables
Text lives in String Table Collections: a spreadsheet where each row is a key and each column is a language.
- Open Window > Asset Management > Localization Tables.
- Choose New Table Collection, type String Table Collection, name it (for example “UI”), tick all your locales and click Create.
- Add entries: a key such as
menu.playand the text in each language column: “Play”, “Jouer”, “Spielen”.
Keep keys descriptive and grouped by prefix (menu., hud., dialog.npc_baker.). Split large games into several collections (UI, Dialog, Items) so translators and loading stay manageable. Only the tables you use get loaded.
Localizing UI Text
For a TextMeshPro text in uGUI, the fastest way is to right-click the TextMeshPro component header and choose Localize. Unity adds a Localize String Event component. In it:
- Set String Reference to your table and key (a searchable dropdown).
- Check that the Update String event is wired to the text’s
textproperty. The Localize menu item does this for you.
Enter Play mode and change the language from the Locale dropdown in the Game view toolbar (added by the package). The text updates instantly.
For UI Toolkit, Unity 6 supports binding localized strings to element properties in UI Builder: select an element, right-click a property like text, add a binding, and choose a Localized String. You can also set the text from code as in the next section.
Localized Strings in Code
For text you set from scripts, use a LocalizedString field. It shows the same table-and-key picker in the Inspector:
using TMPro;
using UnityEngine;
using UnityEngine.Localization;
public class QuestTitle : MonoBehaviour
{
[SerializeField] LocalizedString title; // pick table + key in the Inspector
[SerializeField] TMP_Text label;
void OnEnable()
{
// Called now and again whenever the language changes
title.StringChanged += UpdateText;
}
void OnDisable() => title.StringChanged -= UpdateText;
void UpdateText(string value) => label.text = value;
}
Subscribing to StringChanged is the recommended way: it gives you the translated text as soon as the table has loaded, and again every time the player switches language. For a one-off lookup, such as a notification, use GetLocalizedStringAsync(), or look up by table and key:
using UnityEngine.Localization.Settings;
string msg = await LocalizationSettings.StringDatabase
.GetLocalizedStringAsync("UI", "notify.saved").Task;
Smart Strings: Variables and Plurals
Never build sentences by concatenating translated pieces (“You have” + count + “coins”). Word order differs between languages. Instead, tick Smart on a table entry and put placeholders in the text itself:
- English:
You have {coins} coins - German:
Du hast {coins} Münzen
Pass the value through the LocalizedString’s arguments or local variables:
using UnityEngine.Localization.SmartFormat.PersistentVariables;
[SerializeField] LocalizedString coinsText; // entry with Smart ticked
IntVariable coins;
void Awake()
{
coins = new IntVariable { Value = 0 };
coinsText.Add("coins", coins); // name must match {coins}
}
public void SetCoins(int value) => coins.Value = value; // text updates automatically
Smart Strings also handle plurals, with rules per language: {coins:plural:You have {} coin|You have {} coins}. Languages with more plural forms (Polish, Russian, Arabic) get the right number of options automatically when translators fill them in.
🧰 Tools that save weeks
Localization is one of many big systems indie teams build from scratch. Our roundup of the best Asset Store tools covers the paid assets we think are worth it for saving time on others.
Localizing Images and Audio
Signs with text in them, voice lines and flags need a different asset per language. Use an Asset Table Collection (same Localization Tables window, choose Asset Table Collection). Each row maps a key to a sprite, audio clip, texture or prefab per language.
Then right-click an Image or AudioSource component and choose Localize, or add a Localize Sprite Event / Localize Audio Clip Event component and pick the entry. In code, use LocalizedSprite, LocalizedAudioClip or the generic LocalizedAsset<T>, which work like LocalizedString.
A Language Selection Menu
Changing SelectedLocale updates every localized element in the game:
using System.Collections.Generic;
using TMPro;
using UnityEngine;
using UnityEngine.Localization.Settings;
public class LanguageDropdown : MonoBehaviour
{
[SerializeField] TMP_Dropdown dropdown;
async void Start()
{
await LocalizationSettings.InitializationOperation.Task; // wait for setup
var locales = LocalizationSettings.AvailableLocales.Locales;
var options = new List<string>();
int current = 0;
for (int i = 0; i < locales.Count; i++)
{
options.Add(locales[i].LocaleName); // or a native name like "Deutsch"
if (locales[i] == LocalizationSettings.SelectedLocale) current = i;
}
dropdown.ClearOptions();
dropdown.AddOptions(options);
dropdown.SetValueWithoutNotify(current);
dropdown.onValueChanged.AddListener(i =>
{
LocalizationSettings.SelectedLocale = locales[i];
PlayerPrefs.SetString("language", locales[i].Identifier.Code);
});
}
}
To restore the saved choice on the next launch, add a Player Pref Locale Selector at the top of the Locale Selectors list in Localization Settings, with the same key (“language”). It stores the locale code the same way.
Fonts for Other Languages
A font asset only contains the characters you generated it with. Switch to Japanese with a Latin-only font and every character renders as an empty box.
- Pick source fonts that cover your languages, for example the Noto family, which covers almost every script.
- Use Dynamic font assets (the default when creating a TextMeshPro font asset in recent versions). They add characters as they’re needed, which is essential for Chinese, Japanese and Korean with thousands of characters.
- Add language-specific fonts to your main font’s Fallback Font Assets list. When a character is missing from the main font, TextMeshPro checks the fallbacks in order.
- For right-to-left languages like Arabic and Hebrew, text shaping support is limited. Test early or budget for an asset that adds it.
Working with Translators
Translators rarely want to work in Unity. The package can export and import string tables as CSV (and XLIFF, a standard translation format): in the Localization Tables window, select the collection and use Export / Import. There’s also a Google Sheets extension to sync a table with a shared spreadsheet.
Tips that save rework:
- Add a context comment to each entry (“Button, max 12 characters”). Translators can’t see your UI.
- Test with German early. Its words run long and break layouts. Use auto-size or flexible layouts rather than fixed-width text boxes.
- Make a fake “pseudo-locale” with long, accented text (the package includes a Pseudo-Locale feature) to catch hard-coded strings and overflow before paying for translation.
Troubleshooting
Text shows the key or is empty in a build
Localization tables are loaded through Addressables. Make sure Addressables content is built with the player (the default setting), or build it from the Addressables Groups window before building the player.
Text doesn’t change when switching language
The text is set from code once, instead of through a Localize String Event or a StringChanged subscription. Something else may also be overwriting the text after the localization event runs.
Empty boxes instead of characters
The font doesn’t contain those characters. Add a font that does as a fallback, and use a dynamic font asset.
“No Locale Selected” or the wrong starting language
Check the Locale Selectors order and make sure a Specific Locale selector at the end points to a locale that exists.
Smart String shows {coins} literally
The entry’s Smart checkbox isn’t ticked, or the variable name doesn’t match the placeholder.
FAQ
How do I localize a Unity game?
Install the Localization package, create locales, put text in String Table Collections, and connect UI with Localize String Event components or LocalizedString fields in code.
How do I change language at runtime in Unity?
Set LocalizationSettings.SelectedLocale to one of LocalizationSettings.AvailableLocales.Locales. All localized elements update automatically.
Does Unity Localization work with TextMeshPro?
Yes. Right-click the TextMeshPro component and choose Localize, or set the text from a LocalizedString in code.
How do I show Japanese or Chinese text?
Use a font that contains those characters, as a dynamic TextMeshPro font asset, and add it as a fallback to your main font.
Can I import translations from a spreadsheet?
Yes. Export and import CSV or XLIFF from the Localization Tables window, or use the Google Sheets extension.
Why is my localized text missing in the build?
Tables are loaded with Addressables, so the Addressables content must be built. Check that it’s built with the player.
What is com.unity.localization?
It’s the package name of Unity’s official Localization package. Install it from Window > Package Manager > Unity Registry > Localization, or with Add package by name and com.unity.localization. Its code lives in the UnityEngine.Localization namespace.
Reader questions
Asked by readers of this article and answered by AI. Behavior can differ between Unity versions, so test in yours.




Leave a Reply