Exemplo n.º 1
0
        public CultureSelectorResult GetCulture(HttpContextBase context)
        {
            var cultureCookie = _cookieCultureService.GetCulture();

            if (cultureCookie == null || string.Equals(cultureCookie, "Browser", StringComparison.InvariantCultureIgnoreCase))
            {
                return(null);
            }

            var cultureName = _cookieCultureService.GetSpecificOrNeutralCulture(cultureCookie);

            return(cultureName == null ? null : new CultureSelectorResult {
                Priority = _cookieCultureService.GetSettings().Priority, CultureName = cultureName
            });
        }
Exemplo n.º 2
0
        public CultureSelectorResult GetCulture(HttpContextBase context)
        {
            var cultureCookie = _cookieCultureService.GetCulture();

            if (cultureCookie == null)
            {
                return(null);
            }

            var cultureName = CultureHelper.GetSpecificCulture(cultureCookie);

            return(cultureName == null ? null : new CultureSelectorResult {
                Priority = 0, CultureName = cultureName
            });
        }