add translation for validation text

enad-pre-live
enadhilal 4 years ago
parent a3057b0126
commit 490c525e08

@ -35,71 +35,70 @@ export class ChangePasswordComponent implements OnInit {
public OLD_PASSWORD: boolean = false; public OLD_PASSWORD: boolean = false;
public recentPasswordNote = { public recentPasswordNote = {
yellowImg: '../assets/icon/yellow.svg', yellowImg: '../assets/imgs/mohemm-action/info.png',
text: 'Do not user recent password.', text: this.ts.trPK('login', 'current-password-validation')
}; };
public isLowerCase = { public isLowerCase = {
blankImg: '../assets/icon/blank.svg', blankImg: '../assets/icon/blank.svg',
greenImg: '../assets/icon/green.svg', greenImg: '../assets/icon/green.svg',
redImg: '../assets/imgs/close.svg', redImg: '../assets/imgs/close.svg',
text: 'At least one lowercase.', text: this.ts.trPK('login', 'lowercase-password-validation'),
isMatch: false isMatch: false
}; };
public isUpperCase = { public isUpperCase = {
blankImg: '../assets/icon/blank.svg', blankImg: '../assets/icon/blank.svg',
greenImg: '../assets/icon/green.svg', greenImg: '../assets/icon/green.svg',
redImg: '../assets/imgs/close.svg', redImg: '../assets/imgs/close.svg',
text: 'At least one uppdercase.', text: this.ts.trPK('login', 'uppercase-password-validation'),
isMatch: false isMatch: false
}; };
public isLetterCase = { public isLetterCase = {
blankImg: '../assets/icon/blank.svg', blankImg: '../assets/icon/blank.svg',
greenImg: '../assets/icon/green.svg', greenImg: '../assets/icon/green.svg',
redImg: '../assets/imgs/close.svg', redImg: '../assets/imgs/close.svg',
text: 'At least one Letter.', text: this.ts.trPK('login', 'letter-password-validation'),
isMatch: false isMatch: false
}; };
public isHasDigit = { public isHasDigit = {
blankImg: '../assets/icon/blank.svg', blankImg: '../assets/icon/blank.svg',
greenImg: '../assets/icon/green.svg', greenImg: '../assets/icon/green.svg',
redImg: '../assets/imgs/close.svg', redImg: '../assets/imgs/close.svg',
text: 'At least one nomeric.', text: this.ts.trPK('login', 'numerica-password-validation'),
isMatch: false isMatch: false
}; };
public isMinLength = { public isMinLength = {
blankImg: '../assets/icon/blank.svg', blankImg: '../assets/icon/blank.svg',
greenImg: '../assets/icon/green.svg', greenImg: '../assets/icon/green.svg',
redImg: '../assets/imgs/close.svg', redImg: '../assets/imgs/close.svg',
text: 'Minimum 8 characters.', text: this.ts.trPK('login', 'min-password-validation'),
isMatch: false isMatch: false
}; };
public isRepeatedLetter = { public isRepeatedLetter = {
blankImg: '../assets/icon/blank.svg', blankImg: '../assets/icon/blank.svg',
greenImg: '../assets/icon/green.svg', greenImg: '../assets/icon/green.svg',
redImg: '../assets/imgs/close.svg', redImg: '../assets/imgs/close.svg',
text: 'Do not add repeating letters.', text: this.ts.trPK('login', 'repeating-password-validation'),
isMatch: false isMatch: false
}; };
public isContainSpecialChar = { public isContainSpecialChar = {
blankImg: '../assets/icon/blank.svg', blankImg: '../assets/icon/blank.svg',
greenImg: '../assets/icon/green.svg', greenImg: '../assets/icon/green.svg',
redImg: '../assets/imgs/close.svg', redImg: '../assets/imgs/close.svg',
text: 'It should contain special character.', text: this.ts.trPK('login', 'special-character-password-validation'),
isMatch: false isMatch: false
}; };
public confirmMatchNew = { public confirmMatchNew = {
blankImg: '../assets/icon/blank.svg', blankImg: '../assets/icon/blank.svg',
greenImg: '../assets/icon/green.svg', greenImg: '../assets/icon/green.svg',
redImg: '../assets/imgs/close.svg', redImg: '../assets/imgs/close.svg',
text: 'Confirm Password does not match.', text: this.ts.trPK('login', 'not-match-password-validation'),
isMatch: false isMatch: false
}; };
public userNameMatchNew = { public userNameMatchNew = {
blankImg: '../assets/icon/blank.svg', blankImg: '../assets/icon/blank.svg',
greenImg: '../assets/icon/green.svg', greenImg: '../assets/icon/green.svg',
redImg: '../assets/imgs/close.svg', redImg: '../assets/imgs/close.svg',
text: 'password should not contain the user name.', text: this.ts.trPK('login', 'contain-username-password-validation'),
isMatch: false isMatch: false
}; };
public userId: string; public userId: string;
@ -278,62 +277,62 @@ export class ChangePasswordComponent implements OnInit {
// return this.isUpperCase.redImg; // return this.isUpperCase.redImg;
// } // }
case 1: case 1:
if (/[a-zA-Z]/.test(this.P_NEW_PASSWORD)) { if (/[a-zA-Z]/.test(this.P_NEW_PASSWORD)) {
this.isLetterCase.isMatch = true; this.isLetterCase.isMatch = true;
return this.isLetterCase.greenImg; return this.isLetterCase.greenImg;
} else { } else {
this.isLetterCase.isMatch = false; this.isLetterCase.isMatch = false;
return this.isLetterCase.redImg; return this.isLetterCase.redImg;
} }
case 3: case 3:
if (/[0-9]/.test(this.P_NEW_PASSWORD)) { if (/[0-9]/.test(this.P_NEW_PASSWORD)) {
this.isHasDigit.isMatch = true; this.isHasDigit.isMatch = true;
return this.isHasDigit.greenImg; return this.isHasDigit.greenImg;
} else { } else {
this.isHasDigit.isMatch = false; this.isHasDigit.isMatch = false;
return this.isHasDigit.redImg; return this.isHasDigit.redImg;
} }
case 4: case 4:
if (this.P_NEW_PASSWORD.length >= 8) { if (this.P_NEW_PASSWORD.length >= 8) {
this.isMinLength.isMatch = true; this.isMinLength.isMatch = true;
return this.isMinLength.greenImg; return this.isMinLength.greenImg;
} else { } else {
this.isMinLength.isMatch = false; this.isMinLength.isMatch = false;
return this.isMinLength.redImg; return this.isMinLength.redImg;
} }
case 5: case 5:
if (/([a-z])\1/i.test(this.P_NEW_PASSWORD)) { if (/([a-z])\1/i.test(this.P_NEW_PASSWORD)) {
this.isRepeatedLetter.isMatch = false; this.isRepeatedLetter.isMatch = false;
return this.isRepeatedLetter.redImg; return this.isRepeatedLetter.redImg;
} else { } else {
this.isRepeatedLetter.isMatch = true; this.isRepeatedLetter.isMatch = true;
return this.isRepeatedLetter.greenImg; return this.isRepeatedLetter.greenImg;
} }
case 6: case 6:
if (/[ `!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?~]/.test(this.P_NEW_PASSWORD)) { if (/[ `!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?~]/.test(this.P_NEW_PASSWORD)) {
this.isContainSpecialChar.isMatch = true; this.isContainSpecialChar.isMatch = true;
return this.isContainSpecialChar.greenImg; return this.isContainSpecialChar.greenImg;
} else { } else {
this.isContainSpecialChar.isMatch = false; this.isContainSpecialChar.isMatch = false;
return this.isContainSpecialChar.redImg; return this.isContainSpecialChar.redImg;
} }
case 7: case 7:
if (this.P_NEW_PASSWORD !== this.P_Confirm_NEW_PASSWORD) { if (this.P_NEW_PASSWORD !== this.P_Confirm_NEW_PASSWORD) {
this.confirmMatchNew.isMatch = false; this.confirmMatchNew.isMatch = false;
return this.confirmMatchNew.redImg; return this.confirmMatchNew.redImg;
} else { } else {
this.confirmMatchNew.isMatch = true; this.confirmMatchNew.isMatch = true;
return this.confirmMatchNew.greenImg; return this.confirmMatchNew.greenImg;
} }
case 8: case 8:
if (!this.P_NEW_PASSWORD.includes(this.P_USER_NAME)) { if (!this.P_NEW_PASSWORD.includes(this.P_USER_NAME)) {
this.userNameMatchNew.isMatch = true; this.userNameMatchNew.isMatch = true;
return this.userNameMatchNew.greenImg; return this.userNameMatchNew.greenImg;
} else { } else {
this.userNameMatchNew.isMatch = false; this.userNameMatchNew.isMatch = false;
return this.userNameMatchNew.redImg; return this.userNameMatchNew.redImg;
} }
} }
} }
} }

@ -24,69 +24,69 @@ export class ForgotComponent implements OnInit {
public logo = 'assets/icon/login/lock.png'; public logo = 'assets/icon/login/lock.png';
public recentPasswordNote = { public recentPasswordNote = {
yellowImg: '../assets/imgs/mohemm-action/info.png', yellowImg: '../assets/imgs/mohemm-action/info.png',
text: 'Do not user recent password.' text: this.ts.trPK('login', 'current-password-validation')
}; };
public isLowerCase = { public isLowerCase = {
blankImg: '../assets/icon/blank.svg', blankImg: '../assets/icon/blank.svg',
greenImg: '../assets/icon/green.svg', greenImg: '../assets/icon/green.svg',
redImg: '../assets/imgs/close.svg', redImg: '../assets/imgs/close.svg',
text: 'At least one lowercase.', text: this.ts.trPK('login', 'lowercase-password-validation'),
isMatch: false isMatch: false
}; };
public isUpperCase = { public isUpperCase = {
blankImg: '../assets/icon/blank.svg', blankImg: '../assets/icon/blank.svg',
greenImg: '../assets/icon/green.svg', greenImg: '../assets/icon/green.svg',
redImg: '../assets/imgs/close.svg', redImg: '../assets/imgs/close.svg',
text: 'At least one uppdercase.', text: this.ts.trPK('login', 'uppercase-password-validation'),
isMatch: false isMatch: false
}; };
public isLetterCase = { public isLetterCase = {
blankImg: '../assets/icon/blank.svg', blankImg: '../assets/icon/blank.svg',
greenImg: '../assets/icon/green.svg', greenImg: '../assets/icon/green.svg',
redImg: '../assets/imgs/close.svg', redImg: '../assets/imgs/close.svg',
text: 'At least one Letter.', text: this.ts.trPK('login', 'letter-password-validation'),
isMatch: false isMatch: false
}; };
public isHasDigit = { public isHasDigit = {
blankImg: '../assets/icon/blank.svg', blankImg: '../assets/icon/blank.svg',
greenImg: '../assets/icon/green.svg', greenImg: '../assets/icon/green.svg',
redImg: '../assets/imgs/close.svg', redImg: '../assets/imgs/close.svg',
text: 'At least one nomeric.', text: this.ts.trPK('login', 'numerica-password-validation'),
isMatch: false isMatch: false
}; };
public isMinLength = { public isMinLength = {
blankImg: '../assets/icon/blank.svg', blankImg: '../assets/icon/blank.svg',
greenImg: '../assets/icon/green.svg', greenImg: '../assets/icon/green.svg',
redImg: '../assets/imgs/close.svg', redImg: '../assets/imgs/close.svg',
text: 'Minimum 8 characters.', text: this.ts.trPK('login', 'min-password-validation'),
isMatch: false isMatch: false
}; };
public isRepeatedLetter = { public isRepeatedLetter = {
blankImg: '../assets/icon/blank.svg', blankImg: '../assets/icon/blank.svg',
greenImg: '../assets/icon/green.svg', greenImg: '../assets/icon/green.svg',
redImg: '../assets/imgs/close.svg', redImg: '../assets/imgs/close.svg',
text: 'Do not add repeating letters.', text: this.ts.trPK('login', 'repeating-password-validation'),
isMatch: false isMatch: false
}; };
public isContainSpecialChar = { public isContainSpecialChar = {
blankImg: '../assets/icon/blank.svg', blankImg: '../assets/icon/blank.svg',
greenImg: '../assets/icon/green.svg', greenImg: '../assets/icon/green.svg',
redImg: '../assets/imgs/close.svg', redImg: '../assets/imgs/close.svg',
text: 'It should contain special character.', text: this.ts.trPK('login', 'special-character-password-validation'),
isMatch: false isMatch: false
}; };
public confirmMatchNew = { public confirmMatchNew = {
blankImg: '../assets/icon/blank.svg', blankImg: '../assets/icon/blank.svg',
greenImg: '../assets/icon/green.svg', greenImg: '../assets/icon/green.svg',
redImg: '../assets/imgs/close.svg', redImg: '../assets/imgs/close.svg',
text: 'Confirm Password does not match.', text: this.ts.trPK('login', 'not-match-password-validation'),
isMatch: false isMatch: false
}; };
public userNameMatchNew = { public userNameMatchNew = {
blankImg: '../assets/icon/blank.svg', blankImg: '../assets/icon/blank.svg',
greenImg: '../assets/icon/green.svg', greenImg: '../assets/icon/green.svg',
redImg: '../assets/imgs/close.svg', redImg: '../assets/imgs/close.svg',
text: 'password should not contain the user name.', text: this.ts.trPK('login', 'contain-username-password-validation'),
isMatch: false isMatch: false
}; };
public userId: string; public userId: string;

@ -176,6 +176,46 @@
"check-user-text3": { "check-user-text3": {
"en": "will be sent to your mobile number", "en": "will be sent to your mobile number",
"ar": "سيتم ارساله الى رقم هاتفك" "ar": "سيتم ارساله الى رقم هاتفك"
},
"current-password-validation":{
"en":"Do not use a current password.",
"ar":"لا تستخدم كلمة المرور الحالية."
},
"lowercase-password-validation":{
"en":"At least one lowercase.",
"ar":"حرف صغير واحد على الأقل."
},
"uppercase-password-validation":{
"en":"At least one uppercase.",
"ar":"حرف كبير واحد على الأقل."
},
"letter-password-validation":{
"en":"At least one Letter.",
"ar":"حرف واحد على الأقل."
},
"numerica-password-validation":{
"en":"At least one numeric.",
"ar":"رقم واحد على الأقل."
},
"min-password-validation":{
"en":"Minimum 8 characters.",
"ar":"8 أحرف على الأقل."
},
"repeating-password-validation":{
"en":"Do not add repeating letters.",
"ar":"لا تقم بإضافة أحرف متكررة."
},
"special-character-password-validation":{
"en":"It should contain a special character.",
"ar":"يجب أن يحتوي على طابع خاص."
},
"not-match-password-validation":{
"en":"Confirm Password does not match.",
"ar":"تأكيد كلمة المرور لا يتطابق."
},
"contain-username-password-validation":{
"en":"The password should not contain the user name.",
"ar":"يجب ألا تحتوي كلمة المرور على اسم المستخدم."
} }
}, },
"verificationcode": { "verificationcode": {

Loading…
Cancel
Save