سؤال

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?

هل كانت مفيدة؟

المحلول

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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top