MVC 验证消息 - 本地化? [英] MVC validation messages - localization?

查看:21
本文介绍了MVC 验证消息 - 本地化?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有问题.在主服务器和 localhost 上是完全相同的文件.

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.

在主服务器上我有:

Email 字段为必填项.

正如我所说,文件完全相同.如何解决?

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

推荐答案

你碰巧有

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

在您的 web.config 中?这将自动切换站点的文化以适应通过浏览器请求传递的语言,即 Accept-Language.

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.

如果您想从服务器强制使用语言,只需将 enableClientBasedCulture 设置为 false.

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

这篇关于MVC 验证消息 - 本地化?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆