Пример #1
0
        /// <summary>
        /// </summary>
        /// <param name="cultureInfo"> </param>
        public static Dictionary <string, string> Update(CultureInfo cultureInfo)
        {
            var culture = cultureInfo.TwoLetterISOLanguageName;
            ResourceDictionary dictionary;

            if (Constants.Supported.Contains(culture))
            {
                switch (culture)
                {
                case "ja":
                    dictionary = Japanese.Context();
                    break;

                case "de":
                    dictionary = German.Context();
                    break;

                case "fr":
                    dictionary = French.Context();
                    break;

                default:
                    dictionary = English.Context();
                    break;
                }
            }
            else
            {
                dictionary = English.Context();
            }
            return(dictionary.Cast <DictionaryEntry>()
                   .ToDictionary(item => (string)item.Key, item => (string)item.Value));
        }
Пример #2
0
        /// <summary>
        /// </summary>
        /// <param name="cultureInfo"> </param>
        public static void Update(CultureInfo cultureInfo)
        {
            var culture = cultureInfo.TwoLetterISOLanguageName;
            ResourceDictionary dictionary;

            if (Constants.Supported.Contains(culture))
            {
                switch (culture)
                {
                case "fr":
                    dictionary = French.Context();
                    break;

                case "ja":
                    dictionary = Japanese.Context();
                    break;

                case "de":
                    dictionary = German.Context();
                    break;

                case "zh":
                    dictionary = Chinese.Context();
                    break;

                case "ru":
                    dictionary = Russian.Context();
                    break;

                case "ko":
                    dictionary = Korean.Context();
                    break;

                default:
                    dictionary = English.Context();
                    break;
                }
            }
            else
            {
                dictionary = English.Context();
            }
            var locale = dictionary.Cast <DictionaryEntry>()
                         .ToDictionary(item => (string)item.Key, item => (string)item.Value);

            AppViewModel.Instance.Locale = locale;
            foreach (var pluginInstance in App.Plugins.Loaded.Cast <PluginInstance>()
                     .Where(pluginInstance => pluginInstance.Loaded))
            {
                pluginInstance.Instance.Locale = locale;
            }
        }
Пример #3
0
        /// <summary>
        /// </summary>
        /// <param name="cultureInfo"> </param>
        public static void Update(CultureInfo cultureInfo)
        {
            var culture = cultureInfo.TwoLetterISOLanguageName;
            Dictionary <string, string> dictionary;

            if (Constants.Supported.Contains(culture))
            {
                switch (culture)
                {
                case "fr":
                    dictionary = French.Context();
                    break;

                case "ja":
                    dictionary = Japanese.Context();
                    break;

                case "de":
                    dictionary = German.Context();
                    break;

                case "zh":
                    dictionary = Chinese.Context();
                    break;

                case "ru":
                    dictionary = Russian.Context();
                    break;

                case "ko":
                    dictionary = Korean.Context();
                    break;

                default:
                    dictionary = English.Context();
                    break;
                }
            }
            else
            {
                dictionary = English.Context();
            }

            AppViewModel.Instance.Locale = dictionary;
            foreach (PluginInstance pluginInstance in App.Plugins.Loaded.Cast <PluginInstance>().Where(pluginInstance => pluginInstance.Loaded))
            {
                pluginInstance.Instance.Locale = dictionary;
            }
        }
Пример #4
0
        /// <summary>
        /// </summary>
        /// <param name="cultureInfo"> </param>
        public static Dictionary <string, string> Update(CultureInfo cultureInfo)
        {
            var culture = cultureInfo.TwoLetterISOLanguageName;
            Dictionary <string, string> dictionary;

            if (Constants.Supported.Contains(culture))
            {
                switch (culture)
                {
                case "fr":
                    dictionary = French.Context();
                    break;

                case "ja":
                    dictionary = Japanese.Context();
                    break;

                case "de":
                    dictionary = German.Context();
                    break;

                case "zh":
                    dictionary = Chinese.Context();
                    break;

                case "ru":
                    dictionary = Russian.Context();
                    break;

                default:
                    dictionary = English.Context();
                    break;
                }
            }
            else
            {
                dictionary = English.Context();
            }

            var e = dictionary.ToDictionary(val => val.Key, val => val.Value);

            return(e);
        }