Multiple languages in an ASP.NET MVC application?

前端 未结 6 2103
臣服心动
臣服心动 2020-12-04 12:47

What is the best way to support multiple languages for the interface in an ASP.NET MVC application? I\'ve seen people use resource files for other applications. Is this stil

6条回答
  •  伪装坚强ぢ
    2020-12-04 13:26

    The Orchard project uses a shortcut method called "T" to do all in-page string translations. So you'll see tags with a @T("A String to Translate").

    I intend to look at how this is implemented behind the scenes and potentially use it in future projects. The short name keeps the code cleaner since it will be used a lot.

    What I like about this approach is the original string (english, in this case) is still easily visible in the code, and doesnt require a lookup in a resource tool or some other location to decode what the actual string should be here.

    See http://orchardproject.net for more info.

提交回复
热议问题