public void ChangeLanguage(Dropdown dropdown)
    {
        int lang = dropdown.value;

        Debug.Log(dropdown.options[lang].text);
        Translator.ChangeLanguage(dropdown.options[lang].text);
        PlayerPrefs.SetString("Language", dropdown.options[lang].text);
        tM.ChangeLan();
    }
Beispiel #2
0
        /// <summary>
        /// Languages combo box selected index changes event
        /// </summary>
        /// <param name="sender">Sender</param>
        /// <param name="e">Event arguments</param>
        private void languagesComboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            int i = languagesComboBox.SelectedIndex;

            if (i >= 0)
            {
                List <Language> langs = new List <Language>(Translator.TranslatorInterface.Languages);
                if (Translator.ChangeLanguage(langs[i]))
                {
                    Application.Restart();
                }
            }
        }