diff --git a/frontend/src/app/ui/user-profile/user-profile.component.ts b/frontend/src/app/ui/user-profile/user-profile.component.ts index 2d68d6c36..08ecfba33 100644 --- a/frontend/src/app/ui/user-profile/user-profile.component.ts +++ b/frontend/src/app/ui/user-profile/user-profile.component.ts @@ -317,9 +317,13 @@ export class UserProfileComponent extends BaseComponent implements OnInit, OnDes } Object.keys(errors).forEach(keyError => { if (typeof errors[keyError] === 'boolean') { - this.errorMessages.push(numbering + ' ' + key + ' is ' + keyError); + this.errorMessages.push( + numbering + ' ' + this.language.instant(this.formLabelMap.get(key)?? '') + ' ' + (keyError === 'required'? this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.REQUIRED') : keyError) + ); } else { - this.errorMessages.push(numbering + ' ' + key + ': ' + keyError + ': ' + JSON.stringify(errors[keyError])); + this.errorMessages.push( + numbering + ' ' + this.language.instant(this.formLabelMap.get(key)?? '') + ': ' + keyError + ': ' + JSON.stringify(errors[keyError]) + ); } }); } else { @@ -374,4 +378,14 @@ export class UserProfileComponent extends BaseComponent implements OnInit, OnDes return culture.displayName + ' [' + culture.name + ']'; } + formLabelMap = new Map([ + ['name', 'USER-PROFILE.SETTINGS.NAME'], + ['avatarUrl', 'ALT-TEXT.USER-AVATAR'], + ['timezone', 'USER-PROFILE.SETTINGS.TIMEZONE'], + ['culture', 'USER-PROFILE.SETTINGS.CULTURE'], + ['language', 'USER-PROFILE.SETTINGS.LANGUAGE'], + ['roleOrganization', 'USER-PROFILE.SETTINGS.ROLE'], + ['organization', 'USER-PROFILE.SETTINGS.ORGANIZATION'], + ]) + }