ValidationMessageFor Language

谁说胖子不能爱 提交于 2019-12-11 02:59:04

问题


I am using ASP.NET MVC 5. I am trying to get the message of the ValidationMessageFor in French.

"The xxx field is required" -> "Le champ xxx est manquant".

I have deployed my website in 2 servers

  • Windows Server 2008 R2 SP1 + IIS 7
  • Windows Server 2012 + IIS 8

I added in my web.config this following line:

<globalization culture="fr-FR" uiCulture="fr" />

Finally, I succeed in doing the "translation" for the WS 2012. But not with WS 2008, when I submit a form, I still have "The xxx field is required" in English.

I conclude that it's a problem of server configuration. But which one?

I have tried to:

  • Set the globalization option to French (fr) into IIS
  • Setup a French language pack into WS (my server is now in French)
  • ...etc etc

If anyone has a solution for me...


回答1:


You need to install language pack on the server on which you are hosting your site. Go to Microsoft's official site and you can download them.

  1. Go to below link and select language from dropdown list. In your case "French".

http://www.microsoft.com/en-us/download/details.aspx?id=1246

  1. Then click on download button.

  2. Then save file on your disk and install it.

Please let me know if you have any problem.




回答2:


Microsoft .NET Framework 4.5 Language Pack: http://www.microsoft.com/fr-FR/download/details.aspx?id=30667 fixed my issue.



来源:https://stackoverflow.com/questions/27919446/validationmessagefor-language

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!