diff --git a/Mohem/src/app/authentication/login/login.component.ts b/Mohem/src/app/authentication/login/login.component.ts index 734c72a5..27b71518 100644 --- a/Mohem/src/app/authentication/login/login.component.ts +++ b/Mohem/src/app/authentication/login/login.component.ts @@ -141,7 +141,16 @@ export class LoginComponent implements OnInit, OnDestroy { this.empname = localStorage.getItem('emp-name'); this.logintype = localStorage.getItem('login-type'); // tslint:disable-next-line: radix - this.currentLang = parseInt(localStorage.getItem('lang')); + let isEng = localStorage.getItem('lang') + if(isEng){ + this.currentLang = 2; + this.language = "US"; + this.changeLanguage('2') + }else{ + this.currentLang = 1; + this.language = "AR"; + this.changeLanguage('1') + } // tslint:disable-next-line: triple-equals if (remember == 'true') { this.remeberMe = true; } else { this.remeberMe = false; } } @@ -186,7 +195,13 @@ export class LoginComponent implements OnInit, OnDestroy { public remeberMyInfo() { if (this.username) {localStorage.setItem('user', this.username); } if (this.password) {localStorage.setItem('password', this.password); } - if (this.currentLang) {localStorage.setItem('lang', this.currentLang.toString()); } + if (this.currentLang) { + if(this.currentLang === 1){ + localStorage.setItem('lang', 'ar'); + }else{ + localStorage.setItem('lang', 'en'); + } + } localStorage.setItem('remember', 'true'); } @@ -359,7 +374,7 @@ export class LoginComponent implements OnInit, OnDestroy { let anotherUser = this.sharedData.getSharedData('anotherUser'); if(anotherUser){ this.username = ''; - this.password = ''; + this.password = ''; } console.log('login emit'); console.log('login'); diff --git a/Mohem/src/assets/localization/i18n.json b/Mohem/src/assets/localization/i18n.json index 27ca32e7..fd79c21d 100644 --- a/Mohem/src/assets/localization/i18n.json +++ b/Mohem/src/assets/localization/i18n.json @@ -159,8 +159,8 @@ "ar":"Verify its you" }, "check-user-text1":{ - "en":"Please Enter your Employee ID, A ", - "ar":"يرجى ادخال رقم الموظف " + "en":"Employee ID", + "ar":"رقم الموظف " }, "check-user-text2":{ "en":"login Code ",