/Localisation

A basic Unity localisation package to implement multiple languages in your game

Primary LanguageC#MIT LicenseMIT

Localisation

A Unity Package to enable multiple languages in your game

 namespace JelleVer.Localisation

Installation

This can be imported as a UnityPackage in any existing Unity project through the Package manager with the Git url.

Documentation

You can find the full documentation here: jellevermandere.github.io/Localisation

Workflow

Using this package is pretty straightforward. You need a localisation.csv file in your Resources folder according to this layout:

"key","EN","NL",...
"ID_Example_1","valueEN1","valueNL1",...
"ID_Example_2","valueEN2","valueNL2",...
...

You can freely add any number of languages, the system will automatically detect all the languages.

TextLocaliser

Each Text of TMP_Text object you then want to have translated needs a TextLocaliser component, where the text value in the component will be used to find the correct translation in the .csv. Once the level starts, the value will be updated. You can also update the value at runtime using:

public void UpdateText(string key = ""){ }

LanguageSwitcher

If you want to switch to a different language, you can do so using the LanguageSwitcherwith the function:

public void ChangeLanguage(){ }

This toggles the current language to the next one in the list and updates all the active TextLocaliser objects.

Licensing

The code in this project is licensed under MIT license.