Ajout de la traduction sur la page d'accueil

This commit is contained in:
Sébastien André
2021-05-17 18:08:57 +02:00
parent bc17e7f789
commit 2d3ccbaa48
9 changed files with 63 additions and 24 deletions

View File

@@ -1,6 +1,7 @@
import { Component, OnInit } from "@angular/core";
import { Router, ActivatedRoute } from "@angular/router";
import { FormBuilder, FormGroup, Validators } from "@angular/forms";
import { TranslateService } from "@ngx-translate/core";
import { first } from "rxjs/operators";
@@ -19,12 +20,11 @@ export class CreateUserComponent implements OnInit {
returnUrl: string;
error = "";
constructor(
private formBuilder: FormBuilder,
private route: ActivatedRoute,
private router: Router,
private authenticationService: AuthenticationService
) {
constructor(private formBuilder: FormBuilder,
private route: ActivatedRoute,
private router: Router,
private authenticationService: AuthenticationService,
private translateService: TranslateService) {
// redirect to home if already logged in
if (this.authenticationService.currentUserValue) {
this.router.navigate(["/"]);
@@ -69,6 +69,7 @@ export class CreateUserComponent implements OnInit {
createUser.firstName = this.formCtrls.firstname.value;
createUser.lastName = this.formCtrls.lastname.value;
createUser.email = this.formCtrls.email.value;
createUser.language = this.translateService.currentLang;
this.authenticationService.create(createUser)
.pipe(first())