问题
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.
- 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
Then click on download button.
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