Skip to content

cfrBernard/UnityLiteL10n

Repository files navigation

UnityLiteL10n

A minimal JSON-Based localization tool for Unity – Designed for small projects. [v0.8.0] This tool currently supports static text only. Variables, plurals, and advanced formatting are not implemented yet.

This project is made/test under Unity 6.3 (6000.3.1f1)

You can easily test it via the latest demo build here

Version License

Features:

  • Simple JSON-based localization
  • Runtime language switching
  • Automatic fallback to a default language
  • TextMeshPro support via LocalizedText component
  • Robust loading, audit, and configurable logging

DemoGIF v0.5.0


Setup

  1. Copy the UnityLiteL10n folder into your project under:
Assets/Plugins/
  1. Ensure your localization files are placed in:
Resources/Localization/
  1. Add a LocalizationManager component to a GameObject in your scene.

  2. Set:

  • DefaultLanguage (e.g. EN)
  • CurrentLanguage (e.g. EN)
  1. Optional: Configure debugging settings:
  • missingKeyFormat (default: "[{0}]") for how missing keys are displayed
  • DuplicateKeyPolicy (Overwrite, KeepFirst, Error)
  • LogLevel (None, ErrorsOnly, Warnings, Verbose)
  • strictMode (enable to throw errors on invalid JSON / missing languages)
  • PerformFullAudit (perform post-load audit of all languages against the default language)

LocManager v0.4.0

LocalizationManager inspector – all debug and validation settings are centralized here.


JSON Format

Each language file is a simple JSON file:

{
    "entries": [
        { "key": "menu.test", "value": "EN" },
        { "key": "menu.play", "value": "PLAY" },
        { "key": "menu.settings", "value": "SETTINGS" },
        { "key": "menu.quit", "value": "QUIT" }
    ]
}

  • The filename (e.g. EN.json, FR.json) is used as the language code.
  • JSON entries must now be valid and non-null; empty files will trigger warnings or errors in strictMode

Usage

Localized Text

  1. Add a TextMeshProUGUI to your UI.
  2. Add the LocalizedText component.
  3. Set the localization key (e.g. menu.play).

The text will automatically update when the language changes.


Change Language at Runtime

LocalizationManager.Instance.SetLanguage("FR");

All subscribed LocalizedText components will update automatically.


Reload Localization Data at Runtime

LocalizationManager.Instance.Reload();
  • Clears cached missing keys
  • Reloads all JSON files from Resources/Localization/
  • Triggers update events for all LocalizedText components

This is useful when updating files on the fly.


Debug & Validation

UnityLiteL10n provides optional validation tools to help detect:

  • Missing localization keys
  • Invalid or empty JSON files
  • Duplicate keys
  • Empty keys
  • Extra keys

These tools are configurable via the LocalizationManager. Full debugging features are documented here


Demo (Build)

A demo build is available in: UnityLiteL10n/releases

  • For Windows users.
  • No Unity, no setup required. You can test the tool directly.

Demo (Editor)

A demo scene is available in:

Demo/LocalizationDemo.unity

It showcases:

  • Runtime language switching
  • Multiple localized UI elements
  • JSON-based loading

For JA/KO languages, you will need to assign them as fallbacks in your main (Latin) font. You will find the fonts under Demo/Fonts/.asset


Notes:

  • This tool currently supports static text only.
  • Variables, plurals, and advanced formatting are not implemented yet.
  • For more information about the version, please refer to the changelog section.
  • This project is licensed under the MIT License. See the LICENSE file for details.
  • For more information on debugging tools, go to the DebugFeatures file.
  • More details in the FAQ.

What's Coming:

  • Text variables (e.g. {playerName})
  • Basic editor helpers
  • Optional advanced localization features

Contact:

For issues, suggestions, or contributions, feel free to open an issue on the GitHub repository.

About

A minimal JSON-Based localization tool for Unity – Designed for small projects. [v0.8.0] This tool currently supports static text only. Variables, plurals, and advanced formatting are not implemented yet.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages