diff --git a/src/app/register-page/create-profile/create-profile.component.ts b/src/app/register-page/create-profile/create-profile.component.ts index d042e63ece..0e8e0e8742 100644 --- a/src/app/register-page/create-profile/create-profile.component.ts +++ b/src/app/register-page/create-profile/create-profile.component.ts @@ -41,6 +41,11 @@ export class CreateProfileComponent implements OnInit { userInfoForm: FormGroup; activeLangs: LangConfig[]; + /** + * Prefix for the notification messages of this security form + */ + NOTIFICATIONS_PREFIX = 'register-page.create-profile.submit.'; + constructor( private translateService: TranslateService, private ePersonDataService: EPersonDataService, @@ -161,13 +166,12 @@ export class CreateProfileComponent implements OnInit { getFirstCompletedRemoteData(), ).subscribe((rd: RemoteData) => { if (rd.hasSucceeded) { - this.notificationsService.success(this.translateService.get('register-page.create-profile.submit.success.head'), - this.translateService.get('register-page.create-profile.submit.success.content')); + this.notificationsService.success(this.translateService.get(this.NOTIFICATIONS_PREFIX + 'success.head'), + this.translateService.get(this.NOTIFICATIONS_PREFIX + 'success.content')); this.store.dispatch(new AuthenticateAction(this.email, this.password)); this.router.navigate(['/home']); } else { - this.notificationsService.error(this.translateService.get('register-page.create-profile.submit.error.head'), - this.translateService.get('register-page.create-profile.submit.error.content')); + this.notificationsService.error(this.translateService.get(this.NOTIFICATIONS_PREFIX + 'error.head'), rd.errorMessage); } }); }