-
Notifications
You must be signed in to change notification settings - Fork 4
Runtime changing language
Rodion Lodza edited this page Oct 25, 2020
·
2 revisions
Call the method to change the language Localizator.ChangeLanguage(SystemLanguage language).
Important! Don't forget to subscribe custom scripts that use the localizer for the event Localizator.OnLanguageChanged.
using SimpleLocalization;
using UnityEngine.UI;
using UnityEngine;
public class DynamicText : MonoBehaviour
{
[SerializeField] private Text someText = null;
private void Start()
{
Localizator.OnLanguageChanged += SetText;
SetText();
}
private void SetText()
{
someText.text = Localizator.Translate("diamonds");
}
}