Quick Start

This page helps you get the plugin running as fast as possible. For advanced functionalities, we recommend checking the Complete API.

Localization Component

The easiest way to translate a text is to add a Localization component to it.

Supported localization components:

Component NameDescription

UnityUILocalizationComponent

Works with Unity UI text

TMProLocalizationComponent

Works with Text Mesh Pro text

TMProUGUILocalizationComponent

Works with Text Mesh Pro UI text

NGUILocalizationComponent

Works with nGUI Label

From the WordID enum select the id you want to display.

When this component is active it will display the text associated with the current language of the game.

If the language changes the component will automatically update the text for the new language.

From Script

Display a translated world

using UnityEngine.UI;
using Gley.Localization;

public class Test : MonoBehaviour
{
    public Text yourText;

    public void RefreshText()
    {
        yourText.text = Gley.Localization.API.GetText(WordIDs.YourTextID);
    }
}

Set current language

using Gley.Localization;

public class Test : MonoBehaviour
{
    public void SetLanguage()
    {
        Gley.Localization.API.SetCurrentLanguage(SupportedLanguages.French);
    }
}

Load Example Settings

Load Example Settings loads the config required for the example scenes to work.

By loading example settings you will lose any custom configuration previously made inside Settings Window. All settings will be replaced with default ones.

This concludes the Quick Start. Check the Complete API for advanced functionalities.

For a complete example check the scene included in the package:

Assets/Gley/Localization/Example/Scenes/LocalizationExample.unity

Last updated