using UnityEngine;
using UnityEngine.EventSystems;

public class LocaleButtonHandler : MonoBehaviour,
                                  IPointerClickHandler {

    public string languageKey = "en";

    public void OnPointerClick(PointerEventData eventData) {
        Localizer.Instance.LoadLocalizationFile(languageKey);
        LocalizeText[] allLocalizedTexts
                     = GameObject.FindObjectsOfType<LocalizeText>();
        foreach (LocalizeText localizeText in allLocalizedTexts) {
            localizeText.Start();
        }
    }
}
