Skip to content

Commit

Permalink
Merge pull request #25 from heshanu/loginI18n
Browse files Browse the repository at this point in the history
Login page i18n implmented
  • Loading branch information
heshanu authored Aug 12, 2024
2 parents d91e72f + 9b9dc38 commit f1afac7
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 8 deletions.
9 changes: 5 additions & 4 deletions src/app/login/login.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,22 @@
<h2>{{'LOGIN'| translate}}</h2>

<mat-error *ngIf="!loginValid">
The username and password were not recognized
{{'LOGIN_FORM_LOGIN_ALL_CREDINTIAL_WRONG'|translate}}
</mat-error>
<mat-form-field>
<input matInput placeholder="Email" pattern="[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}" [(ngModel)]="username" name="username" required>
<mat-error>
Please provide a valid email address
{{'EMAIL_ERROR'| translate}}
</mat-error>
</mat-form-field>
<mat-form-field>
<input matInput type="password" placeholder="Password" [(ngModel)]="password" name="password" required>
<mat-error>
Please provide a valid password
{{'PASSWORD_ERROR'|translate}}
</mat-error>
</mat-form-field>
<button mat-raised-button color="primary" [disabled]="!loginForm.form.valid">Login</button>
<button mat-raised-button color="primary"
[disabled]="!loginForm.form.valid">{{'LOGIN_BTN'| translate }}</button>
</form>
</mat-card-content>
</mat-card>
7 changes: 6 additions & 1 deletion src/assets/i18n/de.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"HELLO_WORLD": "Hallo, Welt!",
"LOGIN":"LOGIN"
"LOGIN":"LOGIN",
"LOGIN_FORM_LOGIN_ALL_CREDINTIAL_WRONG":"Der Benutzername und das Passwort wurden nicht erkannt",
"EMAIL_ERROR":"Bitte geben Sie eine gültige E-Mail-Adresse ans",
"PASSWORD_ERROR":"Bitte geben Sie ein gültiges Passwort ein",
"LOGIN_BTN":"LOGIN"

}

9 changes: 7 additions & 2 deletions src/assets/i18n/en.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{

"HELLO_WORLD": "Hello, World!",
"LOGIN":"LOGIN"
}
"LOGIN":"LOGIN",
"LOGIN_FORM_LOGIN_ALL_CREDINTIAL_WRONG":"The username and password were not recognized",
"EMAIL_ERROR":" Please provide a valid email address",
"PASSWORD_ERROR":"Please provide a valid password",
"LOGIN_BTN":"LOGIN"
}

6 changes: 5 additions & 1 deletion src/assets/i18n/ru.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{
"HELLO_WORLD": "Привет, мир!",
"LOGIN":"Авторизоваться"
"LOGIN":"Авторизоваться",
"LOGIN_FORM_LOGIN_ALL_CREDINTIAL_WRONG":"Имя пользователя и пароль не были распознаны",
"EMAIL_ERROR":"Пожалуйста, укажите действительный адрес электронной почты",
"PASSWORD_ERROR":"Пожалуйста, укажите действительный пароль",
"LOGIN_BTN":"Авторизоваться"
}

0 comments on commit f1afac7

Please sign in to comment.