From: Alexander Köplinger Date: Tue, 24 Nov 2015 14:26:39 +0000 (+0100) Subject: Merge pull request #2208 from martinbooth/dataannotation_strings_from_corefx_without_resx X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=21a3421f4c1a40a0b3af25e2533e3fef72e31869;hp=3fceb6d87da96dcb4c973d4422a5ec76b91c3715;p=mono.git Merge pull request #2208 from martinbooth/dataannotation_strings_from_corefx_without_resx [System.ComponentModel.DataAnnotations] Replaced data annotation error messages with values extracted from corefx resource file --- diff --git a/mcs/class/System.ComponentModel.DataAnnotations/DataAnnotationsResources.cs b/mcs/class/System.ComponentModel.DataAnnotations/DataAnnotationsResources.cs index 2427cdd39ae..ed196f9e643 100644 --- a/mcs/class/System.ComponentModel.DataAnnotations/DataAnnotationsResources.cs +++ b/mcs/class/System.ComponentModel.DataAnnotations/DataAnnotationsResources.cs @@ -3,57 +3,57 @@ namespace System.ComponentModel.DataAnnotations.Resources static class DataAnnotationsResources { public const string ArgumentIsNullOrWhitespace = "The argument '{0}' cannot be null, empty or contain only white space."; - public const string AssociatedMetadataTypeTypeDescriptor_MetadataTypeContainsUnknownProperties = "AssociatedMetadataTypeTypeDescriptor_MetadataTypeContainsUnknownProperties"; - public const string AttributeStore_Unknown_Property = "AttributeStore_Unknown_Property"; - public const string Common_PropertyNotFound = "Common_PropertyNotFound"; + public const string AssociatedMetadataTypeTypeDescriptor_MetadataTypeContainsUnknownProperties = "The associated metadata type for type '{0}' contains the following unknown properties or fields: {1}. Please make sure that the names of these members match the names of the properties on the main type."; + public const string AttributeStore_Unknown_Property = "The type '{0}' does not contain a public property named '{1}'."; + public const string Common_PropertyNotFound = "The property {0}.{1} could not be found."; public const string CompareAttribute_MustMatch = "'{0}' and '{1}' do not match."; - public const string CompareAttribute_UnknownProperty = "CompareAttribute_UnknownProperty"; - public const string CreditCardAttribute_Invalid = "CreditCardAttribute_Invalid"; - public const string CustomValidationAttribute_Method_Must_Return_ValidationResult = "CustomValidationAttribute_Method_Must_Return_ValidationResult"; - public const string CustomValidationAttribute_Method_Not_Found = "CustomValidationAttribute_Method_Not_Found"; - public const string CustomValidationAttribute_Method_Required = "CustomValidationAttribute_Method_Required"; - public const string CustomValidationAttribute_Method_Signature = "CustomValidationAttribute_Method_Signature"; - public const string CustomValidationAttribute_Type_Conversion_Failed = "CustomValidationAttribute_Type_Conversion_Failed"; - public const string CustomValidationAttribute_Type_Must_Be_Public = "CustomValidationAttribute_Type_Must_Be_Public"; + public const string CompareAttribute_UnknownProperty = "Could not find a property named {0}."; + public const string CreditCardAttribute_Invalid = "The {0} field is not a valid credit card number."; + public const string CustomValidationAttribute_Method_Must_Return_ValidationResult = "The CustomValidationAttribute method '{0}' in type '{1}' must return System.ComponentModel.DataAnnotations.ValidationResult. Use System.ComponentModel.DataAnnotations.ValidationResult.Success to represent success."; + public const string CustomValidationAttribute_Method_Not_Found = "The CustomValidationAttribute method '{0}' does not exist in type '{1}' or is not public and static."; + public const string CustomValidationAttribute_Method_Required = "The CustomValidationAttribute.Method was not specified."; + public const string CustomValidationAttribute_Method_Signature = "The CustomValidationAttribute method '{0}' in type '{1}' must match the expected signature: public static ValidationResult {0}(object value, ValidationContext context). The value can be strongly typed. The ValidationContext parameter is optional."; + public const string CustomValidationAttribute_Type_Conversion_Failed = "Could not convert the value of type '{0}' to '{1}' as expected by method {2}.{3}."; + public const string CustomValidationAttribute_Type_Must_Be_Public = "The custom validation type '{0}' must be public."; public const string CustomValidationAttribute_ValidationError = "{0} is not valid."; - public const string CustomValidationAttribute_ValidatorType_Required = "CustomValidationAttribute_ValidatorType_Required"; - public const string DataTypeAttribute_EmptyDataTypeString = "DataTypeAttribute_EmptyDataTypeString"; + public const string CustomValidationAttribute_ValidatorType_Required = "The CustomValidationAttribute.ValidatorType was not specified."; + public const string DataTypeAttribute_EmptyDataTypeString = "The custom DataType string cannot be null or empty."; public const string DisplayAttribute_PropertyNotSet = "The {0} property has not been set. Use the {1} method to get the value."; - public const string EmailAddressAttribute_Invalid = "The {0} field is not a valid email address"; - public const string EnumDataTypeAttribute_TypeCannotBeNull = "EnumDataTypeAttribute_TypeCannotBeNull"; - public const string EnumDataTypeAttribute_TypeNeedsToBeAnEnum = "EnumDataTypeAttribute_TypeNeedsToBeAnEnum"; - public const string FileExtensionsAttribute_Invalid = "FileExtensionsAttribute_Invalid"; - public const string LocalizableString_LocalizationFailed = "Cannot retrieve property '{0}' because localization failed. Type '{1}' is not public or does not contain a public static string property with the name '{2}'."; + public const string EmailAddressAttribute_Invalid = "The {0} field is not a valid e-mail address."; + public const string EnumDataTypeAttribute_TypeCannotBeNull = "The type provided for EnumDataTypeAttribute cannot be null."; + public const string EnumDataTypeAttribute_TypeNeedsToBeAnEnum = "The type '{0}' needs to represent an enumeration type."; + public const string FileExtensionsAttribute_Invalid = "The {0} field only accepts files with the following extensions: {1}"; + public const string LocalizableString_LocalizationFailed = "Cannot retrieve property '{0}' because localization failed. Type '{1}' is not public or does not contain a public static string property with the name '{2}'."; public const string MaxLengthAttribute_InvalidMaxLength = "MaxLengthAttribute must have a Length value that is greater than zero. Use MaxLength() without parameters to indicate that the string or array can have the maximum allowable length."; public const string MaxLengthAttribute_ValidationError = "The field {0} must be a string or array type with a maximum length of '{1}'."; - public const string MetadataTypeAttribute_TypeCannotBeNull = "MetadataTypeAttribute_TypeCannotBeNull"; + public const string MetadataTypeAttribute_TypeCannotBeNull = "MetadataClassType cannot be null."; public const string MinLengthAttribute_InvalidMinLength = "MinLengthAttribute must have a Length value that is zero or greater."; - public const string MinLengthAttribute_ValidationError = "The field {0} must be a string or array type with a minimum length of '{1}'"; - public const string PhoneAttribute_Invalid = "PhoneAttribute_Invalid"; - public const string RangeAttribute_ArbitraryTypeNotIComparable = "RangeAttribute_ArbitraryTypeNotIComparable"; - public const string RangeAttribute_MinGreaterThanMax = "RangeAttribute_MinGreaterThanMax"; - public const string RangeAttribute_Must_Set_Min_And_Max = "RangeAttribute_Must_Set_Min_And_Max"; - public const string RangeAttribute_Must_Set_Operand_Type = "RangeAttribute_Must_Set_Operand_Type"; + public const string MinLengthAttribute_ValidationError = "The field {0} must be a string or array type with a minimum length of '{1}'."; + public const string PhoneAttribute_Invalid = "The {0} field is not a valid phone number."; + public const string RangeAttribute_ArbitraryTypeNotIComparable = "The type {0} must implement {1}."; + public const string RangeAttribute_MinGreaterThanMax = "The maximum value '{0}' must be greater than or equal to the minimum value '{1}'."; + public const string RangeAttribute_Must_Set_Min_And_Max = "The minimum and maximum values must be set."; + public const string RangeAttribute_Must_Set_Operand_Type = "The OperandType must be set when strings are used for minimum and maximum values."; public const string RangeAttribute_ValidationError = "The field {0} must be between {1} and {2}."; - public const string RegexAttribute_ValidationError = "The field {0} must match the regular expression {1}."; + public const string RegexAttribute_ValidationError = "The field {0} must match the regular expression '{1}'."; public const string RegularExpressionAttribute_Empty_Pattern = "The pattern must be set to a valid regular expression."; public const string RequiredAttribute_ValidationError = "The {0} field is required."; - public const string StringLengthAttribute_InvalidMaxLength = "StringLengthAttribute_InvalidMaxLength"; + public const string StringLengthAttribute_InvalidMaxLength = "The maximum length must be a nonnegative integer."; public const string StringLengthAttribute_ValidationError = "The field {0} must be a string with a maximum length of {1}."; - public const string StringLengthAttribute_ValidationErrorIncludingMinimum = "StringLengthAttribute_ValidationErrorIncludingMinimum"; - public const string UIHintImplementation_ControlParameterKeyIsNotAString = "UIHintImplementation_ControlParameterKeyIsNotAString"; - public const string UIHintImplementation_ControlParameterKeyIsNull = "UIHintImplementation_ControlParameterKeyIsNull"; - public const string UIHintImplementation_ControlParameterKeyOccursMoreThanOnce = "UIHintImplementation_ControlParameterKeyOccursMoreThanOnce"; - public const string UIHintImplementation_NeedEvenNumberOfControlParameters = "UIHintImplementation_NeedEvenNumberOfControlParameters"; - public const string UrlAttribute_Invalid = "UrlAttribute_Invalid"; - public const string ValidationAttribute_Cannot_Set_ErrorMessage_And_Resource = "ValidationAttribute_Cannot_Set_ErrorMessage_And_Resource"; - public const string ValidationAttribute_IsValid_NotImplemented = "ValidationAttribute_IsValid_NotImplemented"; - public const string ValidationAttribute_NeedBothResourceTypeAndResourceName = "ValidationAttribute_NeedBothResourceTypeAndResourceName"; - public const string ValidationAttribute_ResourcePropertyNotStringType = "ValidationAttribute_ResourcePropertyNotStringType"; - public const string ValidationAttribute_ResourceTypeDoesNotHaveProperty = "ValidationAttribute_ResourceTypeDoesNotHaveProperty"; + public const string StringLengthAttribute_ValidationErrorIncludingMinimum = "The field {0} must be a string with a minimum length of {2} and a maximum length of {1}."; + public const string UIHintImplementation_ControlParameterKeyIsNotAString = "The key parameter at position {0} with value '{1}' is not a string. Every key control parameter must be a string."; + public const string UIHintImplementation_ControlParameterKeyIsNull = "The key parameter at position {0} is null. Every key control parameter must be a string."; + public const string UIHintImplementation_ControlParameterKeyOccursMoreThanOnce = "The key parameter at position {0} with value '{1}' occurs more than once."; + public const string UIHintImplementation_NeedEvenNumberOfControlParameters = "The number of control parameters must be even."; + public const string UrlAttribute_Invalid = "The {0} field is not a valid fully-qualified http, https, or ftp URL."; + public const string ValidationAttribute_Cannot_Set_ErrorMessage_And_Resource = "Either ErrorMessageString or ErrorMessageResourceName must be set, but not both."; + public const string ValidationAttribute_IsValid_NotImplemented = "IsValid(object value) has not been implemented by this class. The preferred entry point is GetValidationResult() and classes should override IsValid(object value, ValidationContext context)."; + public const string ValidationAttribute_NeedBothResourceTypeAndResourceName = "Both ErrorMessageResourceType and ErrorMessageResourceName need to be set on this attribute."; + public const string ValidationAttribute_ResourcePropertyNotStringType = "The property '{0}' on resource type '{1}' is not a string type."; + public const string ValidationAttribute_ResourceTypeDoesNotHaveProperty = "The resource type '{0}' does not have an accessible static property named '{1}'."; public const string ValidationAttribute_ValidationError = "The field {0} is invalid."; - public const string ValidationContextServiceContainer_ItemAlreadyExists = "ValidationContextServiceContainer_ItemAlreadyExists"; - public const string Validator_InstanceMustMatchValidationContextInstance = "Validator_InstanceMustMatchValidationContextInstance"; - public const string Validator_Property_Value_Wrong_Type = "Validator_Property_Value_Wrong_Type"; + public const string ValidationContextServiceContainer_ItemAlreadyExists = "A service of type '{0}' already exists in the container."; + public const string Validator_InstanceMustMatchValidationContextInstance = "The instance provided must match the ObjectInstance on the ValidationContext supplied."; + public const string Validator_Property_Value_Wrong_Type = "The value for property '{0}' must be of type '{1}'."; } }