A lightweight, easy-to-use localization system for Unity supporting TextMeshPro UI text, dynamic string formatting, ScriptableObject language configuration, automatic keyword coloring, localized audio clips, and one-click Google Sheets CSV synchronization.
- Auto Setup Installer Window — Automatically pops up on first install (or anytime via
Tools > Simple Localization > Setup Resources) to createLocalizationData.csv,SupportedLanguages.asset,ColorTexts.asset, andAudio/folders directly inAssets/Resources/Localization/. - CSV-Based Text Localization (UTF-8 with BOM) — Excel-friendly UTF-8 with BOM encoding, supporting multi-language columns, commas and quotes inside sentences, and dynamic
string.Formatarguments ({0},{1}). - Configurable Supported Languages — Manage active languages in the Unity Inspector via the
SupportedLanguagesScriptableObject (Create > Localization > Supported Languages). - Auto Color Keywords (
ColorTexts) — Automatically highlight specific words or phrases across all localized strings with custom colors via aColorTextsScriptableObject. - Audio Localization — Automatically swaps
AudioClipassets on anAudioSourceper language based on the localization key. - Google Sheet Sync Tool — Built-in Editor window (
Tools > Simple Localization > Google Sheet Sync) that downloads your Google Sheet directly intoLocalizationData.csv(encoded as UTF-8 with BOM).
- Open Window > Package Manager in Unity.
- Click the
+button in the top-left corner and select Add package from git URL.... - Enter the package Git URL:
https://github.com/project-SIMPLE/com.simple.localization.git
As soon as the package finishes installing, the Simple Localization Setup window automatically pops up if Assets/Resources/Localization has not been set up yet.
- You can also open this window at any time from
Tools > Simple Localization > Setup Resources. - Check the items you want to create in your project (
LocalizationData.csv,SupportedLanguages.asset,ColorTexts.asset, andAudio/folders) and click Install Selected Resources.
At runtime, LocalizationManager and LocalizedKey load data from Assets/Resources/Localization/:
Assets/
└── Resources/
└── Localization/
├── LocalizationData.csv # Main translation table - UTF-8 with BOM (Required)
├── SupportedLanguages.asset # Active languages list (Required)
├── ColorTexts.asset # Auto-colored keywords (Optional)
└── Audio/ # Localized voiceovers/audio (Optional)
├── English/
│ └── <localizationKey>.wav
├── Vietnamese/
│ └── <localizationKey>.wav
└── French/
└── <localizationKey>.wav
LocalizationManager reads Assets/Resources/Localization/SupportedLanguages.asset to determine which language columns in the CSV should be loaded.
- Use
Tools > Simple Localization > Setup Resourcesto generateSupportedLanguages.assetautomatically (or right-clickAssets/Resources/Localizationand select Create > Localization > Supported Languages). - In the Inspector, add the exact names of the languages you want to use (e.g.,
English,Vietnamese,French).Important: Each language name must match its corresponding column header in
LocalizationData.csv.
Edit Assets/Resources/Localization/LocalizationData.csv (saved as UTF-8 with BOM so Vietnamese/French accents display properly in Microsoft Excel):
- Column 0 must be the Localization Key.
- Subsequent columns represent languages (headers must match the entries in
SupportedLanguages.asset). Any extra helper columns (such asNotesorScene) not listed inSupportedLanguages.assetare safely ignored. - Commas
,and quotation marks"inside sentences are automatically handled by the CSV parser. - Use
{0},{1}, etc. for dynamic runtime values.
Example LocalizationData.csv:
Localization Key,English,Vietnamese,French,Notes
mainMenu.start,Start,Bắt đầu,Commencer,Main menu start button
mainMenu.options,Options,Tùy chọn,Options,Main menu options button
mainMenu.end,Exit,Thoát,Quitter,Main menu exit button
sample.greeting,"Hello, welcome!","Xin chào, chào mừng!","Bonjour, bienvenue !",Contains comma
sample.score,Score: {0}/{1},Điểm: {0}/{1},Score : {0}/{1},Dynamic arguments- Create an empty GameObject named
LocalizationManagerin your initial/bootstrap scene. - Attach the
LocalizationManagercomponent to it. - In the Inspector, set
Current Languageto your default startup language (e.g.,EnglishorVietnamese).LocalizationManagerusesDontDestroyOnLoadautomatically and persists across scenes asLocalizationManager.Instance.
- Select any GameObject in your scene that has a TextMeshPro - Text (UI) (
TextMeshProUGUI) component. - Add the
LocalizedKeycomponent. - Set
Localization Keyin the Inspector (e.g.,mainMenu.start).- If
Text Componentis left empty,LocalizedKeyautomatically grabs theTextMeshProUGUIcomponent on the same GameObject onStart().
- If
LocalizationManager.Instance.SetLanguage("English");All active LocalizedKey components in the scene automatically subscribe to LocalizationManager.OnLanguageChanged and refresh immediately.
If your CSV value is "Score: {0}/{1}":
LocalizedKey scoreText = GetComponent<LocalizedKey>();
scoreText.SetFormatArguments(currentScore, maxScore);string text = LocalizationManager.Instance.GetLocalizedValue("sample.greeting");
string currentLang = LocalizationManager.Instance.GetLanguage();private void OnEnable()
{
LocalizationManager.OnLanguageChanged += OnLanguageChanged;
}
private void OnDisable()
{
LocalizationManager.OnLanguageChanged -= OnLanguageChanged;
}
private void OnLanguageChanged()
{
// Refresh custom UI or state
}LocalizedKey can automatically load and assign localized AudioClip files when the language changes.
- Place your audio files under
Assets/Resources/Localization/Audio/<LanguageName>/<LocalizationKey>(e.g.,.wav,.mp3,.ogg).- Example for key
Key.Narrator.Dialogue.01:Assets/Resources/Localization/Audio/English/Key.Narrator.Dialogue.01.wavAssets/Resources/Localization/Audio/Vietnamese/Key.Narrator.Dialogue.01.wavAssets/Resources/Localization/Audio/French/Key.Narrator.Dialogue.01.wav
- Example for key
- On the GameObject with
LocalizedKey, add or reference anAudioSourcecomponent in theAudio Sourcefield ofLocalizedKey. - Whenever the scene starts or
LocalizationManager.Instance.SetLanguage(...)is called,LocalizedKeyautomatically loads the matchingAudioClipfor the active language and assigns it toaudioSource.clip.
You can automatically highlight specific words or terms across all localized text without manually writing <color=#...> tags in every cell of your CSV.
- Open
Assets/Resources/Localization/ColorTexts.asset(or create it via Tools > Simple Localization > Setup Resources / Create > Localization > Color Texts). - In the Inspector, add entries to the
Color Textslist:Text: The word or phrase to highlight (e.g.,RIVIERE,PFAS,Warning).Color: The color to apply.
- Ensure Rich Text is enabled on your
TextMeshProUGUIcomponents (enabled by default). - When
LocalizationManagerloads the CSV data, every occurrence of each configured word is automatically wrapped in<color=#RRGGBB>...</color>(case-insensitive matching while preserving the original uppercase/lowercase text).
Instead of manually exporting and copying CSV files, you can synchronize LocalizationData.csv directly from Google Sheets inside the Unity Editor.
- Create your localization table in Google Sheets (Row 1 = headers with
Localization Keyand your language names). - Share the Google Sheet so Unity can download it:
- Click Share (top-right in Google Sheets) → Under General access, select Anyone with the link (Viewer), OR
- Go to File > Share > Publish to web and publish the sheet as Comma-separated values (.csv).
- In Unity, open
Tools > Simple Localization > Google Sheet Sync. - Configure the fields:
- Google Sheet CSV URL: Paste your Google Sheet link. You can paste either:
- The standard browser URL (
https://docs.google.com/spreadsheets/d/<ID>/edit#gid=0) — the tool automatically converts/editor/viewlinks into direct CSV export URLs (.../export?format=csv&gid=...). - Or a direct CSV export / published link.
- The standard browser URL (
- Save Path: Path where the downloaded CSV will be saved (default:
Assets/Resources/Localization/LocalizationData.csv).
- Google Sheet CSV URL: Paste your Google Sheet link. You can paste either:
- Click Synchronize Now.
- Unity will download the CSV, validate that it is not an HTML login page, save
LocalizationData.csvas UTF-8 with BOM (so it opens cleanly in Excel), and refresh theAssetDatabase.- Your URL and Save Path are automatically saved in
EditorPrefsbetween sessions.
- Your URL and Save Path are automatically saved in