Ejemplo n.º 1
0
        /// <summary>
        /// Called after the action method executes.
        /// </summary>
        /// <param name="filterContext">The filter context.</param>
        public void OnActionExecuted(ActionExecutedContext filterContext)
        {
            var language = I18NSession.GetLanguageFromSession(filterContext.HttpContext)
                           ?? _service.GetBestAvailableLanguageFrom(filterContext.HttpContext.Request.UserLanguages)
                           ?? I18N.DefaultTwoLetterISOLanguageName;

            filterContext.HttpContext.Response.AppendHeader(ContentLanguageHeader, language);
        }
Ejemplo n.º 2
0
 public LanguageFilter()
 {
     _session = new I18NSession();
     _service = DefaultSettings.LocalizingService;
 }
Ejemplo n.º 3
0
 public LanguageRouteDecorator(RouteBase route) : base(route)
 {
     _session = new I18NSession();
 }
Ejemplo n.º 4
0
 protected I18NController()
 {
     _session = new I18NSession();
 }
Ejemplo n.º 5
0
 /// <summary>
 /// 
 /// </summary>
 public LanguageFilter()
 {
     _session = new I18NSession();
     _service = DefaultSettings.LocalizingService;
 }
Ejemplo n.º 6
0
 protected I18NWebViewPage()
 {
     _session = new I18NSession();
 }
Ejemplo n.º 7
0
 public LanguageFilter()
 {
     _session = new I18NSession();
     _service = DependencyResolver.LocalizingService;
 }
Ejemplo n.º 8
0
 protected I18NController()
 {
     _session = new I18NSession();
 }
Ejemplo n.º 9
0
 public LanguageFilter()
 {
     _session = new I18NSession();
     _service = DependencyResolver.LocalizingService;
 }