trying to localize

This commit is contained in:
Paul Schneider 2019-06-16 01:10:52 +01:00
commit b9a75b71b8
32 changed files with 510 additions and 68 deletions

View file

@ -0,0 +1,20 @@
using System;
using System.Reflection;
namespace Yavsc.Attributes.Validation
{
public class YaRegularExpression : System.ComponentModel.DataAnnotations.RegularExpressionAttribute {
public YaRegularExpression(string pattern): base (pattern)
{
this.ErrorMessage = pattern;
}
public override string FormatErrorMessage(string name)
{
var prop = this.ErrorMessageResourceType.GetProperty(ErrorMessageResourceName);
return (string) prop.GetValue(null, BindingFlags.Static, null, null, System.Globalization.CultureInfo.CurrentUICulture);
}
}
}