0

I just follow the steps in the following link ASP.NET MVC 5 culture in route and url

I just followed the instructions to create localized website with arabic as default language "ar" and english as second language . it works but it seems it doesn't set the culture in the thread and keeps showing the english page with english resources . I tried to debug and follow the code line by line it doesn't pass through OnAuthorization !!!

and this is my code in global to set

FilterConfig.RegisterGlobalFilters(new GlobalFilterCollection()); 
AreaRegistration.RegisterAllAreas(); 
GlobalConfiguration.Configure(WebApiConfig.Register); 
RouteConfig.RegisterRoutes(RouteTable.Routes);      
BundleConfig.RegisterBundles(BundleTable.Bundles);

Shall I set attribute somewhere ?? because on authorization is not running at all

Need assistance . Thanks

Community
  • 1
  • 1
  • Even when I type 'ar' as culture paramter in the url it keeps showing the english resource. the 'ar' is the default – Tamer Kamal Apr 04 '16 at 14:55

1 Answers1

0

You are not setting the global filters correctly. They need to be added to a static collection that MVC then reads.

Change:

FilterConfig.RegisterGlobalFilters(new GlobalFilterCollection());

To:

FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
NightOwl888
  • 55,572
  • 24
  • 139
  • 212