Multilingual rules

Topics: Validation Application Block
Aug 27, 2010 at 10:59 AM

I know that ValidationApplicationBlock can become multilingual by using MessageTemplateResourceName and MessageTemplateResourceTypeName on each rule.

Having many rules will produce less readable code.

Why not create a new attribute called [ValidationResourceMapping(Path.To.My.Resource.file)] and then look for ClassName.PropertyName in the stringtable for field names and validationrulename for rule translations?

example

[ValidationResourceMapping(MyNamespace.Resource1)]
class User
{
   [CustomRule]
   public string FirstName {get;set;}
}
VAB would look for these entries in the stringTable:
User.FirstName 		Förnamn
CustomRule		Du måste ange {0}
Quite easier to handle.
Aug 31, 2010 at 3:25 AM

Thanks for your insight on this jgauffin, you can actually log this in the issue tracker as a feature request for future releases though the decision and assessment will still be made by the entlib team whether to have this or not. If you also want to contribute by doing this enhancement on your own you can share it via the entlib contrib project.

Gino Terrado
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com