如何本地化数据注释

发布于 2024-12-18 23:08:07 字数 79 浏览 5 评论 0原文

将显示属性添加到属性,然后让 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦归所梦 2024-12-25 23:08:07

看起来 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 the ResourceType property to the type of your resources class.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文