srkirkland/DataAnnotationsExtensions — Issue #28: Localization needed
Author: dotnetwise
Created: 2012-01-06 22:47:37+00:00
State: open

public override string FormatErrorMessage(string name)
{
if (ErrorMessage == null && ErrorMessageResourceName == null)
{
ErrorMessage = ValidatorResources.EmailAddressAttribute_Invalid;
}
...

Your standard error messages are not localizable in any way.

You should create a singleton that can be overridden in global.asax by user's own localization mechanism.
i.e. public class ValidationMessages {
public static ValidationMessages Instance { get; set; }
static ValidationMessages()
{
Instance = new ValidationMessages();
}

public virtual string EmailAddressAttribute_Invalid { get { return ValidatorResources.EmailAddressAttribute_Invalid; } }
....
}

This way I can override your implementation with my custom own - which could be another resource file or even another translation mechanism (i.e. using I18N .po files)