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 { TypeValueWrapper } from '@models/file/type-value.wrapper';
import { humanize } from '../../../../utils/functions';
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
@Component({
selector: 'redaction-add-edit-dictionary-dialog',
@ -89,11 +90,11 @@ export class AddEditDictionaryDialogComponent {
() => this._dialogRef.close(true),
error => {
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) {
this._toaster.error('add-edit-dictionary.error.invalid-color-or-rank');
this._toaster.error(_('add-edit-dictionary.error.invalid-color-or-rank'));
} 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 { DossierAttributesService } from '@shared/services/controller-wrappers/dossier-attributes.service';
import { dossierAttributeTypesTranslations } from '../../translations/dossier-attribute-types-translations';
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
@Component({
selector: 'redaction-add-edit-dossier-attribute-dialog',
@ -80,7 +81,7 @@ export class AddEditDossierAttributeDialogComponent extends AutoUnsubscribeCompo
},
(error: HttpErrorResponse) => {
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', {
licenseCustomer
});
const lineBreak = '%0D%0A';
const body = [
this._translateService.instant('license-info-screen.email.body.analyzed', {
pages: this.currentInfo.numberOfAnalyzedPages
@ -100,7 +101,7 @@ export class LicenseInformationScreenComponent implements OnInit {
this._translateService.instant('license-info-screen.email.body.licensed', {
pages: this.totalLicensedNumberOfPages
})
].join('%0D%0A');
].join(lineBreak);
window.location.href = `mailto:${this.appConfigService.getConfig('LICENSE_EMAIL')}?subject=${subject}&body=${body}`;
}

View File

@ -1,11 +1,17 @@
<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">
<div class="dialog-content">
<div class="red-input-group w-300 required">
<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-option *ngFor="let userId of singleUsersSelectOptions" [value]="userId">
{{ userService.getNameForId(userId) }}
@ -17,10 +23,10 @@
<div class="dialog-actions">
<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>
<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>
</form>

View File

@ -21,6 +21,7 @@ import { DossierWrapper } from './model/dossier.wrapper';
import { TypeValueWrapper } from '@models/file/type-value.wrapper';
import { DossierTemplateModelWrapper } from '@models/file/dossier-template-model.wrapper';
import { DossiersService } from '../modules/dossier/services/dossiers.service';
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
export interface AppState {
dossiers: DossierWrapper[];
@ -348,7 +349,7 @@ export class AppStateService {
return foundDossier;
} catch (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-force-redaction': _('annotation-type.suggestion-force-redaction'),
'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"
},
"accept-suggestion": {
"add-to-dict": "Approve and add to dictionary"
"label": "Approve and add to dictionary"
},
"edit-reason": {
"label": "Edit Reason"
@ -236,14 +236,6 @@
"app-name": "DDA-R",
"APPROVED": "Approved",
"archived": "Archived",
"assign-approver-owner": {
"dialog": {
"cancel": "Cancel",
"save": "Save",
"single-user": "Approver",
"title": "Manage File Approver"
}
},
"assign-dossier-owner": {
"dialog": {
"approvers": "Approvers",
@ -258,12 +250,12 @@
"title": "Manage Dossier Team"
}
},
"assign-reviewer-owner": {
"assign-owner": {
"dialog": {
"cancel": "Cancel",
"label": "{type, select, approver{Approver} reviewer{Reviewer} other{}}",
"save": "Save",
"single-user": "Reviewer",
"title": "Manage File Reviewer"
"title": "Manage File {type, select, approver{Approver} reviewer{Reviewer} other{}}"
}
},
"assign-user": {

View File

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