localize
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Resources;
|
||||
|
||||
namespace Yavsc.Attributes.Validation
|
||||
{
|
||||
@ -50,9 +51,11 @@ namespace Yavsc.Attributes.Validation
|
||||
{
|
||||
this.ErrorMessage = pattern;
|
||||
}
|
||||
|
||||
|
||||
public override string FormatErrorMessage(string name)
|
||||
{
|
||||
return Startup.GlobalLocalizer[name];
|
||||
return Startup.GlobalLocalizer[this.ErrorMessageResourceName];
|
||||
}
|
||||
}
|
||||
}
|
BIN
Yavsc/Resources/Yavsc.Resources.YavscLocalisation.en.resources
Normal file
BIN
Yavsc/Resources/Yavsc.Resources.YavscLocalisation.en.resources
Normal file
Binary file not shown.
@ -346,5 +346,9 @@ contact a performer</value></data>
|
||||
<data name="PasswordRequiresNonLetterAndDigit"><value>Passwords must have at least one non letter and non digit character.</value></data>
|
||||
<data name="PasswordRequiresDigit"><value>Passwords must have at least one digit ('0'-'9').</value></data>
|
||||
<data name="PasswordRequiresUpper"><value>Passwords must have at least one uppercase ('A'-'Z').</value></data>
|
||||
<data name="PassAndConfirmDontMach"><value>Passwords and confirmation are not the same.</value></data>
|
||||
<data name="PasswordConfirm"><value>Password confirmation</value></data>
|
||||
<data name="InvalidUserName"><value>Invalid user name.
|
||||
Valid caracters are: underscore '_', '-', 'a' - 'z', 'A' - 'Z', '0' - '9', the space and the dot.</value></data>
|
||||
|
||||
</root>
|
||||
|
BIN
Yavsc/Resources/Yavsc.Resources.YavscLocalisation.fr.resources
Normal file
BIN
Yavsc/Resources/Yavsc.Resources.YavscLocalisation.fr.resources
Normal file
Binary file not shown.
@ -437,7 +437,7 @@
|
||||
<data name="UnsetActivity"><value>Supprimer mon profil professionel</value></data>
|
||||
<data name="Français"><value>Français</value></data>
|
||||
<data name="Anglais"><value>Anglais</value></data>
|
||||
<data name="invalidUserName"><value>Nom d'utilisateur invalide.
|
||||
<data name="InvalidUserName"><value>Nom d'utilisateur invalide.
|
||||
Les valides sont: le souligné '_', le titret '-', de 'a' à 'z', de 'A' à 'Z', de 0 à 9, l'espace et le point.</value></data>
|
||||
<data name="RequiredField"><value>Ce champ est obligatoire.</value></data>
|
||||
<data name="validationError"><value>Champ invalide ...</value></data>
|
||||
@ -445,5 +445,8 @@
|
||||
<data name="PasswordRequiresNonLetterAndDigit"><value>Mot de passe doit contenir au moins a caractère spécial (ni un chiffre, ni une lettre).</value></data>
|
||||
<data name="PasswordRequiresDigit"><value>Les mots de passe doivent contenir au moins un chiffre ('0' à '9').</value></data>
|
||||
<data name="PasswordRequiresUpper"><value>Les mots de passe doivent contenir au moins une lettre majuscule ('A' à 'Z').</value></data>
|
||||
<data name="PassAndConfirmDontMach"><value>Le mot de passe et sa confirmation ne sont pas les mêmes.</value></data>
|
||||
<data name="PasswordConfirm"><value>Confirmation du mot de passe</value></data>
|
||||
|
||||
|
||||
</root>
|
||||
|
@ -1,10 +1,33 @@
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Resources;
|
||||
|
||||
namespace Yavsc.Resources
|
||||
{
|
||||
|
||||
///<summary>
|
||||
/// Makes possible the code injection
|
||||
///</summary>
|
||||
public class YavscLocalisation
|
||||
public class YavscLocalisation : ResourceSet
|
||||
{
|
||||
public YavscLocalisation(string path) : base(path)
|
||||
{
|
||||
}
|
||||
public YavscLocalisation(Stream stream) : base(stream)
|
||||
{
|
||||
}
|
||||
public static string PassAndConfirmDontMach
|
||||
{
|
||||
get
|
||||
{
|
||||
return Startup.GlobalLocalizer["PassAndConfirmDontMach"];
|
||||
}
|
||||
}
|
||||
public static string UserName { get { return Startup.GlobalLocalizer["UserName"]; } }
|
||||
public static string Password { get { return Startup.GlobalLocalizer["Password"]; } }
|
||||
public static string PasswordConfirm { get { return Startup.GlobalLocalizer["PasswordConfirm"]; } }
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -8,27 +8,27 @@ namespace Yavsc.ViewModels.Account
|
||||
// ErrorMessage = "",
|
||||
|
||||
|
||||
[Display(Name = "Nom d'utilisateur")]
|
||||
[Display(ResourceType = typeof(Yavsc.Resources.YavscLocalisation), Name = "UserName")]
|
||||
[StringLength(102)]
|
||||
[YaRegularExpression(@"[a-zA-Z0-9 ._-]+",
|
||||
ErrorMessage = "Caratères autorisés: lettres, chiffres, espace point tiret et souligné.")]
|
||||
[YaRegularExpression(@"[a-zA-Z0-9 ._-]+", ErrorMessageResourceName="InvalidUserName", ErrorMessageResourceType = typeof(Yavsc.Resources.YavscLocalisation))]
|
||||
public string UserName { get; set; }
|
||||
|
||||
[YaRequired("Ce champ est requis.")]
|
||||
[YaRequired()]
|
||||
// [EmailAddress]
|
||||
[Display(Name = "Email")]
|
||||
public string Email { get; set; }
|
||||
|
||||
[YaRequired(ErrorMessage="Spécifiez un mot de passe.")]
|
||||
// [StringLength(100, ErrorMessage = "Le {0} doit être long d'au moins {1} caractères.", MinimumLength = 6)]
|
||||
[DataType(DataType.Password,
|
||||
ErrorMessage = "Les mots de passe doivent contenir au moins un caractère spécial, qui ne soit ni une lettre ni un chiffre.")]
|
||||
[StringLength(100, MinimumLength = 6)]
|
||||
[DataType(DataType.Password)]
|
||||
|
||||
[Display(Name = "Mot de passe")]
|
||||
// ErrorMessage = "Les mots de passe doivent contenir au moins un caractère spécial, qui ne soit ni une lettre ni un chiffre.")]
|
||||
|
||||
[Display(ResourceType = typeof(Yavsc.Resources.YavscLocalisation), Name = "Password")]
|
||||
public string Password { get; set; }
|
||||
|
||||
[Display(Name = "Confirmer le mot de passe")]
|
||||
[Compare("Password", ErrorMessage = "Le mot de passe et sa confirmation ne sont pas les mêmes.")]
|
||||
[DataType(DataType.Password)]
|
||||
[Display(ResourceType = typeof(Yavsc.Resources.YavscLocalisation), Name = "PasswordConfirm")]
|
||||
[Compare("Password", ErrorMessageResourceName = "PassAndConfirmDontMach", ErrorMessageResourceType = typeof(Yavsc.Resources.YavscLocalisation) )]
|
||||
public string ConfirmPassword { get; set; }
|
||||
|
||||
public string GoogleRegId { get; set; }
|
||||
|
@ -85,6 +85,7 @@
|
||||
</a>
|
||||
}
|
||||
</div>
|
||||
|
||||
}
|
||||
|
||||
@section ctxmenu {
|
||||
|
Reference in New Issue
Block a user