Browse Source

Add other validation errors to json localization files #171.

pull/179/head
Halil İbrahim Kalkan 8 years ago
parent
commit
37086fe523
  1. 4
      src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml.cs
  2. 6
      src/Volo.Abp.Account.Web/Pages/Account/Register.cshtml.cs
  3. 2
      src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IdentityRoleCreateOrUpdateDtoBase.cs
  4. 2
      src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IdentityUserCreateDto.cs
  5. 6
      src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IdentityUserCreateOrUpdateDtoBase.cs
  6. 8
      src/Volo.Abp.Identity.Web/Pages/Identity/Users/CreateModal.cshtml.cs
  7. 6
      src/Volo.Abp.Identity.Web/Pages/Identity/Users/EditModal.cshtml.cs
  8. 2
      src/Volo.Abp/Volo/Abp/Localization/Json/JsonEmbeddedFileLocalizationDictionaryProvider.cs
  9. 2
      src/Volo.Abp/Volo/Abp/Localization/LocalizationDictionaryProviderBase.cs
  10. 15
      src/Volo.Abp/Volo/Abp/Localization/Resources/Validation/en.json
  11. 17
      src/Volo.Abp/Volo/Abp/Localization/Resources/Validation/tr.json

4
src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml.cs

@ -59,11 +59,11 @@ namespace Volo.Abp.Account.Web.Pages.Account
public class PostInput
{
[Required]
[MaxLength(255)]
[StringLength(255)]
public string UserNameOrEmailAddress { get; set; }
[Required]
[MaxLength(32)]
[StringLength(32)]
public string Password { get; set; }
public bool RememberMe { get; set; }

6
src/Volo.Abp.Account.Web/Pages/Account/Register.cshtml.cs

@ -58,16 +58,16 @@ namespace Volo.Abp.Account.Web.Pages.Account
public class PostInput
{
[Required]
[MaxLength(32)]
[StringLength(32)]
public string UserName { get; set; }
[Required]
[EmailAddress]
[MaxLength(255)]
[StringLength(255)]
public string EmailAddress { get; set; }
[Required]
[MaxLength(32)]
[StringLength(32)]
public string Password { get; set; }
}
}

2
src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IdentityRoleCreateOrUpdateDtoBase.cs

@ -5,7 +5,7 @@ namespace Volo.Abp.Identity
public class IdentityRoleCreateOrUpdateDtoBase
{
[Required]
[MaxLength(IdentityRoleConsts.MaxNameLength)]
[StringLength(IdentityRoleConsts.MaxNameLength)]
public string Name { get; set; }
}
}

2
src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IdentityUserCreateDto.cs

@ -5,7 +5,7 @@ namespace Volo.Abp.Identity
public class IdentityUserCreateDto : IdentityUserCreateOrUpdateDtoBase
{
[Required]
[MaxLength(IdentityUserConsts.MaxPasswordLength)]
[StringLength(IdentityUserConsts.MaxPasswordLength)]
public string Password { get; set; }
}
}

6
src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IdentityUserCreateOrUpdateDtoBase.cs

@ -6,15 +6,15 @@ namespace Volo.Abp.Identity
public abstract class IdentityUserCreateOrUpdateDtoBase
{
[Required]
[MaxLength(IdentityUserConsts.MaxUserNameLength)]
[StringLength(IdentityUserConsts.MaxUserNameLength)]
public string UserName { get; set; }
[Required]
[EmailAddress]
[MaxLength(IdentityUserConsts.MaxEmailLength)]
[StringLength(IdentityUserConsts.MaxEmailLength)]
public string Email { get; set; }
[MaxLength(IdentityUserConsts.MaxPhoneNumberLength)]
[StringLength(IdentityUserConsts.MaxPhoneNumberLength)]
public string PhoneNumber { get; set; }
public bool TwoFactorEnabled { get; set; }

8
src/Volo.Abp.Identity.Web/Pages/Identity/Users/CreateModal.cshtml.cs

@ -48,23 +48,23 @@ namespace Volo.Abp.Identity.Web.Pages.Identity.Users
public class UserInfoViewModel
{
[Required]
[MaxLength(IdentityUserConsts.MaxUserNameLength)]
[StringLength(IdentityUserConsts.MaxUserNameLength)]
[Display(Name = "UserName")]
public string UserName { get; set; }
[Required]
[MaxLength(IdentityUserConsts.MaxPasswordLength)]
[StringLength(IdentityUserConsts.MaxPasswordLength)]
[DataType(DataType.Password)]
[Display(Name = "Password")]
public string Password { get; set; }
[Required]
[EmailAddress]
[MaxLength(IdentityUserConsts.MaxEmailLength)]
[StringLength(IdentityUserConsts.MaxEmailLength)]
[Display(Name = "EmailAddress")]
public string Email { get; set; }
[MaxLength(IdentityUserConsts.MaxPhoneNumberLength)]
[StringLength(IdentityUserConsts.MaxPhoneNumberLength)]
[Display(Name = "PhoneNumber")]
public string PhoneNumber { get; set; }

6
src/Volo.Abp.Identity.Web/Pages/Identity/Users/EditModal.cshtml.cs

@ -60,17 +60,17 @@ namespace Volo.Abp.Identity.Web.Pages.Identity.Users
public Guid Id { get; set; }
[Required]
[MaxLength(IdentityUserConsts.MaxUserNameLength)]
[StringLength(IdentityUserConsts.MaxUserNameLength)]
[Display(Name = "UserName")]
public string UserName { get; set; }
[Required]
[EmailAddress]
[MaxLength(IdentityUserConsts.MaxEmailLength)]
[StringLength(IdentityUserConsts.MaxEmailLength)]
[Display(Name = "EmailAddress")]
public string Email { get; set; }
[MaxLength(IdentityUserConsts.MaxPhoneNumberLength)]
[StringLength(IdentityUserConsts.MaxPhoneNumberLength)]
[Display(Name = "PhoneNumber")]
public string PhoneNumber { get; set; }

2
src/Volo.Abp/Volo/Abp/Localization/Json/JsonEmbeddedFileLocalizationDictionaryProvider.cs

@ -17,7 +17,7 @@ namespace Volo.Abp.Localization.Json
_rootNamespace = rootNamespace;
}
public override void Initialize()
public override void Initialize() //TODO: Extract initialization to a factory..?
{
var rootNameSpaceWithDot = _rootNamespace + ".";

2
src/Volo.Abp/Volo/Abp/Localization/LocalizationDictionaryProviderBase.cs

@ -4,8 +4,6 @@ namespace Volo.Abp.Localization
{
public abstract class LocalizationDictionaryProviderBase : ILocalizationDictionaryProvider
{
public ILocalizationDictionary DefaultDictionary { get; protected set; }
public IDictionary<string, ILocalizationDictionary> Dictionaries { get; }
protected LocalizationDictionaryProviderBase()

15
src/Volo.Abp/Volo/Abp/Localization/Resources/Validation/en.json

@ -1,7 +1,20 @@
{
"culture": "en",
"texts": {
"'{0}' and '{1}' do not match.": "'{0}' and '{1}' do not match.",
"The {0} field is not a valid credit card number.": "The {0} field is not a valid credit card number.",
"{0} is not valid.": "{0} is not valid.",
"The {0} field is not a valid e-mail address.": "The {0} field is not a valid e-mail address.",
"The {0} field only accepts files with the following extensions: {1}": "The {0} field only accepts files with the following extensions: {1}",
"The field {0} must be a string or array type with a maximum length of '{1}'.": "The field {0} must be a string or array type with a maximum length of '{1}'.",
"The {0} field is required.": "The {0} field is required."
"The field {0} must be a string or array type with a minimum length of '{1}'.": "The field {0} must be a string or array type with a minimum length of '{1}'.",
"The {0} field is not a valid phone number.": "The {0} field is not a valid phone number.",
"The field {0} must be between {1} and {2}.": "The field {0} must be between {1} and {2}.",
"The field {0} must match the regular expression '{1}'.": "The field {0} must match the regular expression '{1}'.",
"The {0} field is required.": "The {0} field is required.",
"The field {0} must be a string with a maximum length of {1}.": "The field {0} must be a string with a maximum length of {1}.",
"The field {0} must be a string with a minimum length of {2} and a maximum length of {1}.": "The field {0} must be a string with a minimum length of {2} and a maximum length of {1}.",
"The {0} field is not a valid fully-qualified http, https, or ftp URL.": "The {0} field is not a valid fully-qualified http, https, or ftp URL.",
"The field {0} is invalid.": "The field {0} is invalid."
}
}

17
src/Volo.Abp/Volo/Abp/Localization/Resources/Validation/tr.json

@ -1,7 +1,20 @@
{
"culture": "tr",
"texts": {
"The field {0} must be a string or array type with a maximum length of '{1}'.": "{0} alanı en fazla '{1}' karakter uzunluğunda olmalıdır.",
"The {0} field is required.": "{0} alanı zorunludur."
"'{0}' and '{1}' do not match.": "'{0}' ve '{1}' eşleşmiyor.",
"The {0} field is not a valid credit card number.": "{0} alanı geçerli bir kredi kartı numarası olmalıdır.",
"{0} is not valid.": "{0} geçerli değil.",
"The {0} field is not a valid e-mail address.": "{0} alanı geçerli bir e-posta adresi olmalıdır.",
"The {0} field only accepts files with the following extensions: {1}": "{0} alanı sadece şu uzantılarda dosyaları kabul eder: {1}",
"The field {0} must be a string or array type with a maximum length of '{1}'.": "{0} alanı en fazla '{1}' uzunluğunda bir metin ya da dizi olmalıdır.",
"The field {0} must be a string or array type with a minimum length of '{1}'.": "{0} alanı en az '{1}' uzunluğunda bir metin ya da dizi olmalıdır.",
"The {0} field is not a valid phone number.": "{0} alanı geçerli bir telefon numarası olmalıdır.",
"The field {0} must be between {1} and {2}.": "{0} değeri {1} ile {2} arasında olmalıdır.",
"The field {0} must match the regular expression '{1}'.": "{0} alanı şu düzenli ifadeye uymalıdır: '{1}'.",
"The {0} field is required.": "{0} alanı zorunludur.",
"The field {0} must be a string with a maximum length of {1}.": "{0} alanı en fazla {1} uzunluğunda bir metin olmalıdır.",
"The field {0} must be a string with a minimum length of {2} and a maximum length of {1}.": "{0} alanı en az {2}, en fazla {1} uzunluğunda bir metin olmalıdır.",
"The {0} field is not a valid fully-qualified http, https, or ftp URL.": "{0} alanı geçerli bir http, https, ya da ftp adresi olmalıdır.",
"The field {0} is invalid.": "{0} alanı geçerli değil."
}
}
Loading…
Cancel
Save