public UserHomeInstaller() { sectionService = new ContentSectionService(); appService = new UserAppService(); menuService = new UserMenuService(); appinfoService = new AppInstallerService(); lbl = lang.getByApp( typeof( ContentApp ) ); }
private static Dictionary <String, LanguageSetting> getLangList(String path) { String[] files = Directory.GetFiles(path); if (files.Length == 0) { System.IO.FileEx.Write(path + "/core.config", "default=Hello World\n"); files = Directory.GetFiles(path); } Dictionary <String, LanguageSetting> results = new Dictionary <String, LanguageSetting>(); foreach (String file in files) { if (Path.GetExtension(file) != ".config") { continue; } String fileName = Path.GetFileNameWithoutExtension(file); Dictionary <String, String> _lang = cfgHelper.Read(file, '='); LanguageSetting lbl = new LanguageSetting(fileName, _lang); results.Add(fileName, lbl); } return(results); }
/// <summary> /// 获取当前 app 的语言包数据 /// </summary> /// <returns></returns> public LanguageSetting getAppLang() { if (_isappLangLoaded) return _langSetting; if (ctx.app != null && ctx.app.getAppType() != null) { _langSetting = wojilu.lang.getByApp( ctx.app.getAppType() ); } _isappLangLoaded = true; return _langSetting; }
private static Dictionary<String, LanguageSetting> getLangList(String path) { String[] files = Directory.GetFiles(path); if (files.Length == 0) { System.IO.FileEx.Write(path + "/core.config", "default=Hello World\n"); files = Directory.GetFiles(path); } Dictionary<String, LanguageSetting> results = new Dictionary<String, LanguageSetting>(); foreach (String file in files) { if (Path.GetExtension(file) != ".config") continue; String fileName = Path.GetFileNameWithoutExtension(file); Dictionary<String, String> _lang = cfgHelper.Read(file, '='); LanguageSetting lbl = new LanguageSetting(fileName, _lang); results.Add(fileName, lbl); } return results; }
private void SetLanguageUI(LanguageSetting languageSetting) { if (autoToolStripMenuItem == null) { return; } autoToolStripMenuItem.Checked = false; if (englishToolStripMenuItem == null) { return; } englishToolStripMenuItem.Checked = false; if (russianToolStripMenuItem == null) { return; } russianToolStripMenuItem.Checked = false; switch (languageSetting) { case LanguageSetting.Auto: autoToolStripMenuItem.Checked = true; break; case LanguageSetting.English: englishToolStripMenuItem.Checked = true; break; case LanguageSetting.Russian: russianToolStripMenuItem.Checked = true; break; } }
private void SetLanguage(LanguageSetting languageSetting) { Fb2EpubGUI.Default.Language = (int)languageSetting; switch (languageSetting) { case LanguageSetting.Auto: Thread.CurrentThread.CurrentUICulture = _autoCulture; Resources.Culture = _autoCulture; break; case LanguageSetting.English: Thread.CurrentThread.CurrentUICulture = _englishCulture; Resources.Culture = _englishCulture; break; case LanguageSetting.Russian: Thread.CurrentThread.CurrentUICulture = _russianCulture; Resources.Culture = _russianCulture; break; } SetLanguageUI(languageSetting); }