예제 #1
0
        public UserHomeInstaller() {
            sectionService = new ContentSectionService();
            appService = new UserAppService();
            menuService = new UserMenuService();
            appinfoService = new AppInstallerService();

            lbl = lang.getByApp( typeof( ContentApp ) );
        }
예제 #2
0
        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);
        }
예제 #3
0
        /// <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;
        }
예제 #4
0
파일: PageBase.cs 프로젝트: mfz888/xcore
 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;
 }
예제 #5
0
 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;
     }
 }
예제 #6
0
 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);
 }