ASP.NET MVC: When to set Thread.CurrentThread.CurrentUICulture?

前端 未结 2 1387
慢半拍i
慢半拍i 2021-01-31 09:31

I am just beginning to localize an ASP.NET MVC application. Most of the strings will be defined in resource files and retrieved via Matt\'s Localization Helpers. Other strings m

2条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-31 09:49

    Here is a sample using an HttpModule:

    http://weblogs.manas.com.ar/smedina/2008/12/17/internationalization-in-aspnet-mvc/

    Other options, create a base Controller class and implement the localization logic there. Or use an action filter attribute, but you'll have to remember to add it on every controller or combine this approach with the base Controller class.

提交回复
热议问题