Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MVC validation messages - localization?

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 jest wymagane.

And on main server I have:

The Email field is required.

As I said, files are exacly the same. How to resolve it?

like image 927
whoah Avatar asked Dec 21 '22 04:12

whoah


1 Answers

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.

like image 168
James Avatar answered Jan 04 '23 22:01

James