开发者

MVC.NET add extra parameter to resx (localisation)

Hi I'm creating a MVC project, with localisation. The project also consists of a small quiz

The questio开发者_StackOverflow社区ns 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?


You could put string formatter tokens into the text in your resource files. So your text would be:

Question10 | "This question is worth {0} points." 

Then in your code you could do:

string.Format(Resources.QuizQuestions.Question10, 15);
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜