如何本地化数据注释
将显示属性添加到属性,然后让 DataField 自动执行其工具提示魔法,这就是一个很棒的演示。但对于我们这些多语言国家的人来说,如何本地化呢?
Adding a Display Attribute to a property then having the DataField automatically do its tooltip magic makes for a great demo. But for those of us in multilingual countries how is that to be localized?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看起来 DisplayAttribute 支持本地化。
请参阅 http: //msdn.microsoft.com/en-us/library/system.componentmodel.dataannotations.displayattribute.resourcetype%28v=VS.95%29.aspx
对于此属性,您可以将
Name
属性设置为资源键,然后将ResourceType
属性设置为资源类的类型。It looks like the DisplayAttribute has support for localization.
See http://msdn.microsoft.com/en-us/library/system.componentmodel.dataannotations.displayattribute.resourcetype%28v=VS.95%29.aspx
For this attribute, you can set the
Name
property to be a resource key, and then set theResourceType
property to the type of your resources class.