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); } }
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)); }
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); }); }