开发者

asp net mvc 2, resx files and page translation

I've used a very interesting article (which i recommend, you can see it here : http://adamyan.blogspot.com/), and i've started to localize my asp net mvc2 site.

However, i've come to a point where i don't know if it would be possible to do something else, or if i just have to do it this way

The thing is, most of the pages are text and links and stuff. In general, all of the links i have them using some markup and calling the Html.ActionLink (for example). So, if i'm translating a pa开发者_JAVA百科ge that has 20 links, i would have to split all of those texts into 20 entries in the resx file (and the Html.ActionLink text would have to have its own resx entry, of course). I find this a little bit unpractical. Is there a way to just copy the whole contents, and make some intermediary parse the tags in the resx file and call the appropriate code?

Thanks


You could write a custom HtmlHelper that knows how to parse those tags. We're doing something similar in our MVC3 application.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜