Exemplo n.º 1
0
 private static void DumpStrings(Type t)
 {
     var langs = new[] { DefaultLanguage }.Concat(Languages);
     var dir = GetResourcePath();
     foreach (var lang in langs)
     {
         TranslationUtil.SetLocalization(t, lang);
         var entries = TranslationUtil.GetLocalization(t);
         var location = GetFileLocationInText(t.Name, dir, lang);
         File.WriteAllLines(location, entries);
         TranslationUtil.SetLocalization(t, DefaultLanguage);
     }
 }
Exemplo n.º 2
0
        private void Menu_Language_SelectedIndexChanged(object sender, EventArgs e)
        {
            Menu_Options.DropDown.Close();
            if ((uint)Menu_Language.SelectedIndex >= GameLanguage.LanguageCount)
            {
                return;
            }
            var lang = GameInfo.SetLanguage2Char(Menu_Language.SelectedIndex);

            this.TranslateInterface(lang);
            var settings = Settings.Default;

            settings.Language = lang;
            settings.Save();

            Task.Run(() => TranslationUtil.SetLocalization(typeof(MessageStrings), lang));
        }
Exemplo n.º 3
0
        private void Menu_Language_SelectedIndexChanged(object sender, EventArgs e)
        {
            Menu_Options.DropDown.Close();
            if ((uint)Menu_Language.SelectedIndex >= GameLanguage.LanguageCount)
            {
                return;
            }
            var lang = GameInfo.SetLanguage2Char(Menu_Language.SelectedIndex);

            this.TranslateInterface(lang);
            var settings = Settings.Default;

            settings.Language = lang;
            settings.Save();

            Task.Run(() =>
            {
                ItemSprite.Initialize(Main.ItemPath, GameInfo.GetStrings("en").itemlist);
                TranslationUtil.SetLocalization(typeof(MessageStrings), lang);
                TranslationUtil.SetLocalization(GameInfo.Strings.InternalNameTranslation, lang);
            });
        }