MVC.NET 向 resx 添加额外参数(本地化)
您好,我正在创建一个具有本地化功能的 MVC 项目。该项目还包括一个小测验,
问题和答案位于本地化文件(resx)中,但我需要为答案添加分数。
有没有一种简单的方法可以将额外的参数(点)添加(映射)到翻译的内容?
Hi I'm creating a MVC project, with localisation. The project also consists of a small quiz
The questions and answers are in a localisation file (resx), but I need to add points to the answers.
Is there an easy way to add (map) an extra parameter (points) to the translated content?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以将字符串格式化程序标记放入资源文件的文本中。所以你的文本将是:
然后在你的代码中你可以这样做:
You could put string formatter tokens into the text in your resource files. So your text would be:
Then in your code you could do: