コード例 #1
0
        protected override void InitializePage()
        {
            var cultureName = Culture;

            Localizer = Localizer.GetCurrent(cultureName);
            base.InitializePage();
        }
コード例 #2
0
        /// <summary>
        /// Returns an anchor element (a element) that contains the virtual path of the specified action, with localized anchor text.
        /// </summary>
        public static MvcHtmlString ActionLinkLocalized(this HtmlHelper htmlHelper, string neutralLinkText, string actionName, object routeValues)
        {
            string cultureName = System.Globalization.CultureInfo.CurrentCulture.ToString();
            var    linkText    = Localizer.GetCurrent(cultureName).Get(neutralLinkText);

            return(htmlHelper.ActionLink(linkText, actionName, routeValues));
        }