protected string SetLocale() { //todo:SetLocale未完成 var lnag = "zh-cn"; var locale = Request.Cookies["LEANOTE_LANG"]; if (string.IsNullOrEmpty(locale)) { locale = lnag; } var languageResource = LanguageFactory.GetLanguageResource(locale); ViewBag.msg = languageResource.GetMsg(); ViewBag.member = languageResource.GetMember(); ViewBag.markdown = languageResource.GetMarkdown(); ViewBag.blog = languageResource.GetBlog(); ViewBag.noteconf = languageResource.GetNote(); ViewBag.tinymce_editor = languageResource.GetTinymce_editor(); ViewBag.demonstrationOnly = configFileService.WebConfig.GlobalConfig.DemonstrationOnly; ViewBag.locale = locale; ViewBag.siteUrl = config.APPConfig.SiteUrl; ViewBag.blogUrl = config.APPConfig.BlogUrl; ViewBag.leaUrl = config.APPConfig.LeaUrl; ViewBag.noteUrl = config.APPConfig.NoteUrl; return(null); }
protected LanguageResource GetLanguageResource() { var lnag = "zh-cn"; var locale = Request.Cookies["LEANOTE_LANG"]; if (string.IsNullOrEmpty(locale)) { locale = lnag; } var languageResource = LanguageFactory.GetLanguageResource(locale); return(languageResource); }