Skip to content

Setting up the plugin

Galahane Rouillé-Poirel edited this page Jun 19, 2023 · 2 revisions

Importing the Plugin

To set up the plugin, just download the latest version here and import it in your Unity projects by going into "Assets > Import Package > Custom Package...".

From there, you'll find a demo scene with the current possible localization components. Give it a go to understand how everything works.

Setting up the possible languages

To set up the languages you want to be able to use, you can open the "Languages.cs" script, found in the "Scripts/LocalizationManagement" folders. In this enum, you can add, remove and modify the different languages you wish to support.

Then, you can go in the "LocalizationManager.cs" script and update the switch statement in the "SetBaseLanguage" function.

/!\ While there is a basic support in the plugin for adding both RTL and LTR languages, it is still under development. If you can, please try to stay with either only RTL or only LTR for now.

Adding the localizers

Next, you can start adding the localizer scripts you'll need in your scene. You can find them by clicking on "AddComponent > Scripts > SinGala.Plugins.Localization".

Alternatively, you can find under the "Prefabs" folder pre-made gameobjects with the correct components and localizers.

Saving the language

To help you get started, you can find a basic Saving System that saves, loads and resets the language chosen by the user. By default, it will try to get the language of the device. If it is part of the supported languages you added, it will switch the current language to it. Otherwise, it will default to English (you can easily update this in the "LocalizationManager.cs" script.

Updating the language

In the demo scene, you'll find a basic example of how to update from one language to another. You can easily create your own custom system for this.

Clone this wiki locally