ValidationCallHandler and Internationalization

Topics: Web Client Software Factory, Project Management Forum, User Forum
Jul 2, 2007 at 7:45 PM
I am trying to rewrite my libraries to handle internationalization of error messages. Unfortunately, validation attributes don't support internationalization as they require string constants for MessageTemplate parameter, so I'm looking at the more laborious task of declaring validators within constructors, properties, and methods, then validating input.

Since I'm not using any external validation rules and manually throw exceptions, do I need to use validators at all to support the use of ValidationCallHandler?

Since I have to throw exceptions manually and can add the error messages to the exceptions, do I still need to add the error messages to the MessageTemplate, or do I not understand how this works?
Jul 3, 2007 at 12:49 AM
You probably want to ask this question in the Enterprise Library Forums.

However, have you looked at using Resource Files? You can use MessageTemplateResourceName and MessageTemplateResourceType with the ValidatorAttributes which should give you what you need for Localization.

I have a post here that describes it in a bit more detail on PnPGuidance.

Validation Application Block Message Template Tokens and Resource Files

Regards,

Dave

________________________________

David Hayden
Microsoft MVP C#