ASP.NET MVC 验证消息未本地化 [英] ASP.NET MVC validation message does not get localized

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

问题描述

我正在使用带有不显眼的客户端验证的 ASP.NET MVC 4.我的应用程序中的语言是德语(在 web.config 文件中定义)

I am using ASP.NET MVC 4 with unobtrusive clientside validation. The language in my application is german (defined in the web.config file)

如果我有一个必填字段(在我的代码优先类中配置了数据注释),则客户端验证工作正常.唯一的缺点:消息没有本地化.

If i have a required field (configured with data-annotations in my Code First Classes), the client side validation works fine. the only downside: The Message is not Localized.

字段 XXXX 为必填项.

The Field XXXX is required.

这个问题有解决办法吗?

Is there a solution out for this problem?

推荐答案

您必须根据您的 .NET Framework 版本安装 .NET Framework 语言包:

You must install the .NET Framework Language pack, according to your .NET Framework version:

Microsoft .NET Framework 4.5 语言包:http://www.microsoft.com/de-de/download/details.aspx?id=30667

Microsoft .NET Framework 4.5 Language Pack: http://www.microsoft.com/de-de/download/details.aspx?id=30667

Microsoft .NET Framework 4 完整语言包:http://www.microsoft.com/de-de/download/details.aspx?id=23067

Microsoft .NET Framework 4 Full Language Pack: http://www.microsoft.com/de-de/download/details.aspx?id=23067

在这些页面中,检查要求,以查看它们是否满足您的需求(即:操作系统版本、x86 或 x64 等).如果它们不能满足您的需求,请在 Google 上搜索Microsoft .NET Framework German Language Pack"之类的内容.

In these pages, check the requirements, in order to see if they meets your needs (i.e.: Operating System Version, x86 or x64, etc.). If they don't meet your needs, search on Google something like "Microsoft .NET Framework German Language Pack".

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

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