One Click Localization
Fast, Value-Based Localization Tool for Unity
What is it?
One Click Localization (OCL) is designed around a simple philosophy: you shouldn't have to think about localization while creating your game.
Unlike traditional systems that require assigning abstract string keys (e.g. UI_TITLE_01) before writing any text, OCL is value-based: your original in-editor strings, textures, and audio clips are your keys. When you're ready to localize, OCL automatically parses your scenes and prefabs, collects everything, and allows you to translate directly or with Microsoft Azure Translator in minutes.
Demos & Video Tutorials
Quick Start Video Tutorial
Survival Shooter Localized in 2 Minutes
Playable WebGL Demo
Test language switching, audio localization, and dynamic parameter replacement live in your browser:
Launch WebGL DemoQuick Start
- Import Package: Import OCL into your Unity project. All assets reside in
Assets/OneClickLocalization. - Configure Build Settings: Ensure all scenes you want to localize are added to File → Build Settings → Scenes In Build.
- Open Setup: Open Window → OneClickLocalization → Setup.
- One Click Setup: Click Start Automatic Setup. OCL parses your scenes and prefabs, automatically extracts texts, and attaches adapters to UI elements.
- Add Languages: Open Window → OneClickLocalization → Localization, add your target languages, and input or auto-translate your strings.
- Play & Test: Hit Play in the editor. To test different languages, switch the active language via the editor window or script API.
Unity Compatibility
- Unity 2020.1+ / 2021 LTS / 2022 LTS — Fully Supported
- Unity 2019.4 LTS — Tested & Supported
- Unity 2018.4 LTS — Minimum Supported Version
- Unity 2017 and older — Deprecated / Unsupported
Editor Tools & Workflow
Data Storage (`OCLSetup.asset`)
OCL persists all configuration and runtime translations in a single ScriptableObject asset:
Assets/OneClickLocalization/Resources/OCLSetup.asset.
OCLSetup.asset is committed to Git/version control so automated builds, Unity Cloud Build, and teammates have all localizations available.
Automatic Setup Settings
- Add OCL Component: Automatically attaches
OCLComponentAdapterto GameObjects holding supported UI components. - Extract Data: Extracts current text, sprite, texture, and audio values into the localization database.
- Includes / Excludes: Filter which component types to parse. By default:
UnityEngine.UI.Text,UnityEngine.UI.Image,UnityEngine.UI.RawImage,UnityEngine.TextMesh,UnityEngine.AudioSource, and NGUIUILabel. - Parse Prefabs & ScriptableObjects: Scan project assets recursively with customizable folder filters.
Microsoft Azure Translator
Translate all extracted strings automatically via Azure Cognitive Services. Add your Azure API Key in the Setup window, then click Translate All in the Localization window.
Import & Export (XML and CSV)
You can export your translations to send to professional translators, and re-import them with a single click:
<?xml version="1.0" encoding="UTF-8"?>
<localization>
<strings>
<string stringId="Start Game">
<value lang="French">Commencer la partie</value>
<value lang="German">Spiel starten</value>
</string>
</strings>
</localization>
StringId,French,German
"Start Game","Commencer la partie","Spiel starten"
"Quit","Quitter","Beenden"
Runtime Components
`OCLComponentAdapter`
The adapter handles automatic runtime updates when the language changes. Supported components include:
UnityEngine.UI.Text(Strings)UnityEngine.TextMesh(Strings)UnityEngine.UI.Image(Sprites)UnityEngine.UI.RawImage(Textures)UnityEngine.AudioSource(AudioClips)UILabel(NGUI)
C# Script API Reference
All runtime methods and events are accessed statically via OneClickLocalization.OCL.
Delegates & Events
| Event | Description |
|---|---|
OCL.onLanguageChanged(oldLang, newLang) |
Triggered whenever the active language changes. |
OCL.onActiveChanged(isActive) |
Triggered when OCL is enabled or disabled. |
OCL.onLanguagesChanged() |
Triggered when languages are added or removed dynamically. |
OCL.onLocalizationChanged(id, lang, val) |
Triggered when a translation value is modified at runtime. |
Key Methods
| Signature | Description |
|---|---|
string GetLocalization(string original) |
Returns translation of string in the current active language. |
string GetLocalization(string original, SystemLanguage lang) |
Returns translation of string for a specific language. |
void SetLanguage(SystemLanguage lang) |
Sets the active language and triggers UI updates. |
SystemLanguage GetLanguage() |
Returns the current active language. |
List<SystemLanguage> GetLanguages() |
Returns list of all supported languages in the project. |
void SetLocalization(string id, SystemLanguage lang, string value) |
Updates or registers a translation value dynamically at runtime. |
Use Cases & Code Samples
1. Translating a String in Code
// Simple translation for current language
string translated = OCL.GetLocalization("Game Over");
// Translation for a specific language
string frenchText = OCL.GetLocalization("Game Over", SystemLanguage.French);
2. Dynamic String Parameters
OCL automatically substitutes dynamic parameters defined with ${0}, ${1}:
// Original text: "Player ${0} scored ${1} points!"
string scoreMessage = OCL.GetLocalization("Player ${0} scored ${1} points!", "Alex", 1500);
3. Language Switcher Dropdown (uGUI)
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using OneClickLocalization;
public class LanguageDropdownController : MonoBehaviour
{
[SerializeField] private Dropdown _dropdown;
private void Start()
{
// Populate dropdown with all supported languages
List<string> options = new List<string>();
foreach (SystemLanguage lang in OCL.GetLanguages())
{
options.Add(lang.ToString());
}
_dropdown.ClearOptions();
_dropdown.AddOptions(options);
// Select current language
_dropdown.value = options.IndexOf(OCL.GetLanguage().ToString());
_dropdown.onValueChanged.AddListener(OnLanguageSelected);
}
private void OnLanguageSelected(int index)
{
string selected = _dropdown.options[index].text;
SystemLanguage newLang = (SystemLanguage)Enum.Parse(typeof(SystemLanguage), selected);
OCL.SetLanguage(newLang);
}
}
4. Adding Languages Dynamically
SystemLanguage targetLang = SystemLanguage.Japanese;
if (!OCL.GetLanguages().Contains(targetLang))
{
OCL.AddLanguage(targetLang);
OCL.SetLocalization("Welcome", targetLang, "ようこそ");
}
FAQ & Troubleshooting
How does value-based localization compare to key-based systems?
TXT_MENU_PLAY_BTN before writing text. OCL uses your actual in-scene English/source strings as the keys. You build your game naturally, and OCL handles extraction and mapping with zero overhead.
Why do I get 401 Unauthorized errors with Azure Translator?
How do I integrate OCL with Unity Cloud Build or CI/CD?
Assets/OneClickLocalization/Resources/OCLSetup.asset. Ensure this asset file is committed to version control so builds compile with all translation data intact.
Can I localize TextMeshPro?
TextMeshProUGUI and TextMeshPro are selected in your included component types.
Contact & Community
Have questions or feedback on One Click Localization? Connect with us: