예제 #1
0
        public string GetElementText(string elName, UISettingsAttributes.Language language)
        {
            string sqlQuery;

            switch (language)
            {
            case UISettingsAttributes.Language.English:
                if (English == null || !English.ContainsKey(elName))
                {
                    sqlQuery = "select ename, english from Languages";
                    if (English == null || !English.ContainsKey(elName))
                    {
                        UpdateDictionaryInfo(ref English, sqlQuery);
                    }
                    if (English != null && English.ContainsKey(elName))
                    {
                        return(English[elName]);
                    }
                }
                else
                {
                    return(English[elName]);
                }
                break;

            case UISettingsAttributes.Language.Lithuanian:
                if (Lithuanian == null || !Lithuanian.ContainsKey(elName))
                {
                    sqlQuery = "select ename, lithuanian from Languages";
                    if (Lithuanian == null || !Lithuanian.ContainsKey(elName))
                    {
                        UpdateDictionaryInfo(ref Lithuanian, sqlQuery);
                    }
                    if (Lithuanian != null && Lithuanian.ContainsKey(elName))
                    {
                        return(Lithuanian[elName]);
                    }
                }
                else
                {
                    return(Lithuanian[elName]);
                }
                break;

            case UISettingsAttributes.Language.Russian:
                if (Russian == null || !Russian.ContainsKey(elName))
                {
                    sqlQuery = "select ename, russian from Languages";
                    if (Russian == null || !Russian.ContainsKey(elName))
                    {
                        UpdateDictionaryInfo(ref Russian, sqlQuery);
                    }
                    if (Russian != null && Russian.ContainsKey(elName))
                    {
                        return(Russian[elName]);
                    }
                }
                else
                {
                    return(Russian[elName]);
                }
                break;
            }
            Debug.Assert(false, elName + " translation not exists");
            return(NotFoundStr);
        }
예제 #2
0
        /// <summary>
        /// Обработчик смены языка
        /// Language change handler
        /// </summary>
        /// <param name="language">Выбранный язык/Chosen language</param> // не используется пока
        private void handleLanguageChange(UISettingsAttributes.Language language)
        {
            string localisedString = table.GetElementText(Key, UISettings.Current.language);

            TextComponent.text = localisedString;
        }
예제 #3
0
 private void handleLanguageChange(UISettingsAttributes.Language language)
 {
     Debug.Log("Languge change to: " + language.ToString());
 }