MVC validation messages - localization?

后端 未结 2 525
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-01 05:30

I have a problem. On main server and localhost are the exacly the same files.

But in localhost I have messages in my home language, like

Pole Email je

相关标签:
2条回答
  • 2021-01-01 05:57

    I had the same problem, the solution for me was to install the correspondant language package in the server (https://support.microsoft.com/en-us/help/14236/language-packs). Inmediatly after that, the validation messages started appearing in the desired language.

    0 讨论(0)
  • 2021-01-01 06:03

    Do you happen to have

    <globalization enableClientBasedCulture="true" uiCulture="auto" culture="auto">...</globalization>
    

    in your web.config? This would automatically switch the culture of the site to suit the language passed via the browser request i.e. Accept-Language.

    If you want to force the language from the server just set enableClientBasedCulture to false.

    0 讨论(0)
提交回复
热议问题