protectedoverridevoidOnActionExecuting(ActionExecutingContext filterContext) { // Grab the culture route parameter string culture = filterContext.RouteData.Values["culture"]?.ToString(); // Set the action parameter just in case we didn't get one // from the route. filterContext.ActionParameters["culture"] = culture; // update this.isChineseCulture this.isChineseCulture = ChineseCultures.Contains(culture.ToLower()); var cultureInfo = CultureInfo.GetCultureInfo(culture); Thread.CurrentThread.CurrentCulture = cultureInfo; Thread.CurrentThread.CurrentUICulture = cultureInfo; // Because we've overwritten the ActionParameters, we // make sure we provide the override to the // base implementation. base.OnActionExecuting(filterContext); } }