@@ -7,7 +7,7 @@ import { Account } from 'app/core/auth/account.model';
77import { PasswordService } from './password.service' ;
88import { PasswordStrengthBarComponent } from './password-strength-bar/password-strength-bar.component' ;
99import { AsyncPipe } from '@angular/common' ;
10- import { TranslateDirective , TranslatePipe } from '@ngx-translate/core' ;
10+ import { TranslateDirective , TranslatePipe , TranslateService } from '@ngx-translate/core' ;
1111
1212@Component ( {
1313 selector : 'jhi-password' ,
@@ -26,6 +26,7 @@ export class PasswordComponent implements OnInit {
2626 private passwordService : PasswordService ,
2727 private accountService : AccountService ,
2828 private fb : UntypedFormBuilder ,
29+ private translateService : TranslateService ,
2930 ) {
3031 this . passwordForm = this . fb . group ( {
3132 currentPassword : [ '' , [ Validators . required ] ] ,
@@ -36,6 +37,11 @@ export class PasswordComponent implements OnInit {
3637
3738 ngOnInit ( ) : void {
3839 this . account$ = this . accountService . identity ( ) ;
40+ this . account$ . subscribe ( account => {
41+ if ( account ?. langKey ) {
42+ this . translateService . use ( account . langKey ) ;
43+ }
44+ } ) ;
3945 }
4046
4147 changePassword ( ) : void {
0 commit comments