Translation rework: fixes

This commit is contained in:
Adina Țeudan 2021-07-22 14:07:38 +03:00
parent 486313d00a
commit f3ebeb841a
8 changed files with 47 additions and 33 deletions

View File

@ -7,6 +7,7 @@ import { Toaster } from '@services/toaster.service';
import { TranslateService } from '@ngx-translate/core'; import { TranslateService } from '@ngx-translate/core';
import { TypeValueWrapper } from '@models/file/type-value.wrapper'; import { TypeValueWrapper } from '@models/file/type-value.wrapper';
import { humanize } from '../../../../utils/functions'; import { humanize } from '../../../../utils/functions';
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
@Component({ @Component({
selector: 'redaction-add-edit-dictionary-dialog', selector: 'redaction-add-edit-dictionary-dialog',
@ -89,11 +90,11 @@ export class AddEditDictionaryDialogComponent {
() => this._dialogRef.close(true), () => this._dialogRef.close(true),
error => { error => {
if (error.status === 409) { if (error.status === 409) {
this._toaster.error('add-edit-dictionary.error.dictionary-already-exists'); this._toaster.error(_('add-edit-dictionary.error.dictionary-already-exists'));
} else if (error.status === 400) { } else if (error.status === 400) {
this._toaster.error('add-edit-dictionary.error.invalid-color-or-rank'); this._toaster.error(_('add-edit-dictionary.error.invalid-color-or-rank'));
} else { } else {
this._toaster.error('add-edit-dictionary.error.generic'); this._toaster.error(_('add-edit-dictionary.error.generic'));
} }
} }
); );

View File

@ -9,6 +9,7 @@ import { Toaster } from '@services/toaster.service';
import { AutoUnsubscribeComponent } from '@shared/base/auto-unsubscribe.component'; import { AutoUnsubscribeComponent } from '@shared/base/auto-unsubscribe.component';
import { DossierAttributesService } from '@shared/services/controller-wrappers/dossier-attributes.service'; import { DossierAttributesService } from '@shared/services/controller-wrappers/dossier-attributes.service';
import { dossierAttributeTypesTranslations } from '../../translations/dossier-attribute-types-translations'; import { dossierAttributeTypesTranslations } from '../../translations/dossier-attribute-types-translations';
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
@Component({ @Component({
selector: 'redaction-add-edit-dossier-attribute-dialog', selector: 'redaction-add-edit-dossier-attribute-dialog',
@ -80,7 +81,7 @@ export class AddEditDossierAttributeDialogComponent extends AutoUnsubscribeCompo
}, },
(error: HttpErrorResponse) => { (error: HttpErrorResponse) => {
this._loadingService.stop(); this._loadingService.stop();
this._toaster.error('add-edit-dossier-attribute.error.generic', { error: error }); this._toaster.error(_('add-edit-dossier-attribute.error.generic'), { error: error });
} }
); );
} }

View File

@ -93,6 +93,7 @@ export class LicenseInformationScreenComponent implements OnInit {
const subject = this._translateService.instant('license-info-screen.email.title', { const subject = this._translateService.instant('license-info-screen.email.title', {
licenseCustomer licenseCustomer
}); });
const lineBreak = '%0D%0A';
const body = [ const body = [
this._translateService.instant('license-info-screen.email.body.analyzed', { this._translateService.instant('license-info-screen.email.body.analyzed', {
pages: this.currentInfo.numberOfAnalyzedPages pages: this.currentInfo.numberOfAnalyzedPages
@ -100,7 +101,7 @@ export class LicenseInformationScreenComponent implements OnInit {
this._translateService.instant('license-info-screen.email.body.licensed', { this._translateService.instant('license-info-screen.email.body.licensed', {
pages: this.totalLicensedNumberOfPages pages: this.totalLicensedNumberOfPages
}) })
].join('%0D%0A'); ].join(lineBreak);
window.location.href = `mailto:${this.appConfigService.getConfig('LICENSE_EMAIL')}?subject=${subject}&body=${body}`; window.location.href = `mailto:${this.appConfigService.getConfig('LICENSE_EMAIL')}?subject=${subject}&body=${body}`;
} }

View File

@ -1,11 +1,17 @@
<section class="dialog"> <section class="dialog">
<div [translate]="'assign-' + data.mode + '-owner.dialog.title'" class="dialog-header heading-l"></div> <div
[translateParams]="{
type: data.mode
}"
[translate]="'assign-owner.dialog.title'"
class="dialog-header heading-l"
></div>
<form (submit)="saveUsers()" [formGroup]="usersForm"> <form (submit)="saveUsers()" [formGroup]="usersForm">
<div class="dialog-content"> <div class="dialog-content">
<div class="red-input-group w-300 required"> <div class="red-input-group w-300 required">
<mat-form-field floatLabel="always"> <mat-form-field floatLabel="always">
<mat-label>{{ 'assign-' + data.mode + '-owner.dialog.single-user' | translate }}</mat-label> <mat-label>{{ 'assign-owner.dialog.label' | translate: { type: data.mode } }}</mat-label>
<mat-select formControlName="singleUser"> <mat-select formControlName="singleUser">
<mat-option *ngFor="let userId of singleUsersSelectOptions" [value]="userId"> <mat-option *ngFor="let userId of singleUsersSelectOptions" [value]="userId">
{{ userService.getNameForId(userId) }} {{ userService.getNameForId(userId) }}
@ -17,10 +23,10 @@
<div class="dialog-actions"> <div class="dialog-actions">
<button [disabled]="!usersForm.valid || !changed" color="primary" mat-flat-button type="submit"> <button [disabled]="!usersForm.valid || !changed" color="primary" mat-flat-button type="submit">
{{ 'assign-' + data.mode + '-owner.dialog.save' | translate }} {{ 'assign-owner.dialog.save' | translate }}
</button> </button>
<div [translate]="'assign-' + data.mode + '-owner.dialog.cancel'" class="all-caps-label pointer cancel" mat-dialog-close></div> <div [translate]="'assign-owner.dialog.cancel'" class="all-caps-label pointer cancel" mat-dialog-close></div>
</div> </div>
</form> </form>

View File

@ -21,6 +21,7 @@ import { DossierWrapper } from './model/dossier.wrapper';
import { TypeValueWrapper } from '@models/file/type-value.wrapper'; import { TypeValueWrapper } from '@models/file/type-value.wrapper';
import { DossierTemplateModelWrapper } from '@models/file/dossier-template-model.wrapper'; import { DossierTemplateModelWrapper } from '@models/file/dossier-template-model.wrapper';
import { DossiersService } from '../modules/dossier/services/dossiers.service'; import { DossiersService } from '../modules/dossier/services/dossiers.service';
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
export interface AppState { export interface AppState {
dossiers: DossierWrapper[]; dossiers: DossierWrapper[];
@ -348,7 +349,7 @@ export class AppStateService {
return foundDossier; return foundDossier;
} catch (error) { } catch (error) {
this._toaster.error( this._toaster.error(
error.status === 409 ? 'add-dossier-dialog.errors.dossier-already-exists' : 'add-dossier-dialog.errors.generic' error.status === 409 ? _('add-dossier-dialog.errors.dossier-already-exists') : _('add-dossier-dialog.errors.generic')
); );
} }
} }

View File

@ -19,5 +19,5 @@ export const annotationTypesTranslations: { [key in AnnotationSuperType]: string
'suggestion-recategorize-image': _('annotation-type.suggestion-recategorize-image'), 'suggestion-recategorize-image': _('annotation-type.suggestion-recategorize-image'),
'suggestion-force-redaction': _('annotation-type.suggestion-force-redaction'), 'suggestion-force-redaction': _('annotation-type.suggestion-force-redaction'),
'suggestion-remove': _('annotation-type.suggestion-remove'), 'suggestion-remove': _('annotation-type.suggestion-remove'),
'suggestion-remove-dictionary': _('suggestion-remove-dictionary') 'suggestion-remove-dictionary': _('annotation-type.suggestion-remove-dictionary')
}; };

View File

@ -112,7 +112,7 @@
"label": "Accept Recommendation" "label": "Accept Recommendation"
}, },
"accept-suggestion": { "accept-suggestion": {
"add-to-dict": "Approve and add to dictionary" "label": "Approve and add to dictionary"
}, },
"edit-reason": { "edit-reason": {
"label": "Edit Reason" "label": "Edit Reason"
@ -236,14 +236,6 @@
"app-name": "DDA-R", "app-name": "DDA-R",
"APPROVED": "Approved", "APPROVED": "Approved",
"archived": "Archived", "archived": "Archived",
"assign-approver-owner": {
"dialog": {
"cancel": "Cancel",
"save": "Save",
"single-user": "Approver",
"title": "Manage File Approver"
}
},
"assign-dossier-owner": { "assign-dossier-owner": {
"dialog": { "dialog": {
"approvers": "Approvers", "approvers": "Approvers",
@ -258,12 +250,12 @@
"title": "Manage Dossier Team" "title": "Manage Dossier Team"
} }
}, },
"assign-reviewer-owner": { "assign-owner": {
"dialog": { "dialog": {
"cancel": "Cancel", "cancel": "Cancel",
"label": "{type, select, approver{Approver} reviewer{Reviewer} other{}}",
"save": "Save", "save": "Save",
"single-user": "Reviewer", "title": "Manage File {type, select, approver{Approver} reviewer{Reviewer} other{}}"
"title": "Manage File Reviewer"
} }
}, },
"assign-user": { "assign-user": {

View File

@ -1,12 +1,5 @@
{ {
"%0D%0A": "",
", ": "", ", ": "",
"-owner": {
"dialog": {
"cancel": "",
"title": ""
}
},
"actions": { "actions": {
"all": "", "all": "",
"none": "" "none": ""
@ -16,6 +9,10 @@
"save": "", "save": "",
"save-and-add-members": "" "save-and-add-members": ""
}, },
"errors": {
"dossier-already-exists": "",
"generic": ""
},
"form": { "form": {
"description": { "description": {
"label": "", "label": "",
@ -32,6 +29,11 @@
"header-new": "" "header-new": ""
}, },
"add-edit-dictionary": { "add-edit-dictionary": {
"error": {
"dictionary-already-exists": "",
"generic": "",
"invalid-color-or-rank": ""
},
"form": { "form": {
"add-to-dictionary-action": "", "add-to-dictionary-action": "",
"case-sensitive": "", "case-sensitive": "",
@ -51,6 +53,9 @@
"title": "" "title": ""
}, },
"add-edit-dossier-attribute": { "add-edit-dossier-attribute": {
"error": {
"generic": ""
},
"form": { "form": {
"label": "", "label": "",
"label-placeholder": "", "label-placeholder": "",
@ -221,10 +226,10 @@
"suggestion-change-legal-basis": "", "suggestion-change-legal-basis": "",
"suggestion-force-redaction": "", "suggestion-force-redaction": "",
"suggestion-recategorize-image": "", "suggestion-recategorize-image": "",
"suggestion-remove": "" "suggestion-remove": "",
"suggestion-remove-dictionary": ""
}, },
"annotations": "", "annotations": "",
"assign-": "",
"assign-dossier-owner": { "assign-dossier-owner": {
"dialog": { "dialog": {
"approvers": "", "approvers": "",
@ -236,6 +241,14 @@
"single-user": "" "single-user": ""
} }
}, },
"assign-owner": {
"dialog": {
"cancel": "",
"label": "",
"save": "",
"title": ""
}
},
"assign-user": { "assign-user": {
"cancel": "", "cancel": "",
"save": "" "save": ""
@ -1074,7 +1087,6 @@
"subtitle": "", "subtitle": "",
"title": "" "title": ""
}, },
"suggestion-remove-dictionary": "",
"top-bar": { "top-bar": {
"navigation-items": { "navigation-items": {
"back": "", "back": "",