开发者

ASP.NET MVC localization: Get a resource instance

开发者 https://www.devze.com 2022-12-25 03:16 出处:网络
I\'m trying to implement this feature. I created a resource and set it access modifier to public, also Custom Tool property value to PublicResXFileCodeGenerator.

I'm trying to implement this feature.

I created a resource and set it access modifier to public, also Custom Tool property value to PublicResXFileCodeGenerator.

I'm trying to get 开发者_高级运维an instance of this resource but I can't, either with strongly type the resource name nor with Type.GetType("WebProject.Resources.Home.ViewModels.ResourceName1");.


I don't like the way MVC is doing localization so I made it my way. You can check my tutorial here: http://kosev.blogspot.com/2010/06/tutorial-create-aspnet-mvc-localization.html

I'm using simple XML language files, then I have Translator class with caching + html helpers for easy translation in html views. Hope this helps.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号