diff --git a/apps/red-ui/src/app/modules/dossier/components/dossier-details/dossier-details.component.ts b/apps/red-ui/src/app/modules/dossier/components/dossier-details/dossier-details.component.ts index feb1885e7..c0499b196 100644 --- a/apps/red-ui/src/app/modules/dossier/components/dossier-details/dossier-details.component.ts +++ b/apps/red-ui/src/app/modules/dossier/components/dossier-details/dossier-details.component.ts @@ -10,6 +10,7 @@ import { User } from '@redaction/red-ui-http'; import { Toaster } from '@services/toaster.service'; import { FilterService } from '@shared/services/filter.service'; import { DossierAttributeWithValue } from '@models/dossier-attributes.model'; +import { fileStatusTranslations } from '../../translations/file-status-translations'; @Component({ selector: 'redaction-dossier-details', @@ -68,7 +69,7 @@ export class DossierDetailsComponent implements OnInit { this.documentsChartData.push({ value: groups[key].length, color: key, - label: key, + label: fileStatusTranslations[key], key: key }); } diff --git a/apps/red-ui/src/app/modules/dossier/screens/dossier-listing-screen/dossier-listing-screen.component.ts b/apps/red-ui/src/app/modules/dossier/screens/dossier-listing-screen/dossier-listing-screen.component.ts index ea86e2e36..598936eb3 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/dossier-listing-screen/dossier-listing-screen.component.ts +++ b/apps/red-ui/src/app/modules/dossier/screens/dossier-listing-screen/dossier-listing-screen.component.ts @@ -30,6 +30,8 @@ import { BaseListingComponent } from '@shared/base/base-listing.component'; import { SortingService } from '@services/sorting.service'; import { TableColConfig } from '@shared/components/table-col-name/table-col-name.component'; import { workloadTranslations } from '../../translations/workload-translations'; +import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; +import { fileStatusTranslations } from '../../translations/file-status-translations'; const isLeavingScreen = event => event instanceof NavigationStart && event.url !== '/main/dossiers'; @@ -159,8 +161,8 @@ export class DossierListingScreenComponent this._computeAllFilters(); this.dossiersChartData = [ - { value: this._activeDossiersCount, color: 'ACTIVE', label: 'active' }, - { value: this._inactiveDossiersCount, color: 'DELETED', label: 'archived' } + { value: this._activeDossiersCount, color: 'ACTIVE', label: _('active') }, + { value: this._inactiveDossiersCount, color: 'DELETED', label: _('archived') } ]; const groups = groupBy(this._appStateService.aggregatedFiles, 'status'); this.documentsChartData = []; @@ -169,7 +171,7 @@ export class DossierListingScreenComponent this.documentsChartData.push({ value: groups[key].length, color: key, - label: key, + label: fileStatusTranslations[key], key: key }); } @@ -205,7 +207,7 @@ export class DossierListingScreenComponent const statusFilters = [...allDistinctFileStatus].map(status => ({ key: status, - label: this._translateService.instant(status) + label: this._translateService.instant(fileStatusTranslations[status]) })); this.filterService.addFilterGroup({ diff --git a/apps/red-ui/src/app/modules/dossier/screens/dossier-overview-screen/dossier-overview-screen.component.ts b/apps/red-ui/src/app/modules/dossier/screens/dossier-overview-screen/dossier-overview-screen.component.ts index f396f0f21..2d808006d 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/dossier-overview-screen/dossier-overview-screen.component.ts +++ b/apps/red-ui/src/app/modules/dossier/screens/dossier-overview-screen/dossier-overview-screen.component.ts @@ -33,6 +33,7 @@ import { DossierAttributesService } from '@shared/services/controller-wrappers/d import { DossierAttributeWithValue } from '@models/dossier-attributes.model'; import { UserPreferenceService } from '@services/user-preference.service'; import { workloadTranslations } from '../../translations/workload-translations'; +import { fileStatusTranslations } from '../../translations/file-status-translations'; @Component({ templateUrl: './dossier-overview-screen.component.html', @@ -259,7 +260,7 @@ export class DossierOverviewScreenComponent const statusFilters = [...allDistinctFileStatusWrapper].map(item => ({ key: item, - label: this._translateService.instant(item) + label: this._translateService.instant(fileStatusTranslations[item]) })); this.filterService.addFilterGroup({ diff --git a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.html b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.html index 91535d836..0e11c468e 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.html +++ b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.html @@ -35,7 +35,7 @@
- {{ status | translate }} + {{ translations[status] | translate }} {{ 'by' | translate }}:
diff --git a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.ts b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.ts index f55db541e..fb6ee69f3 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.ts +++ b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.ts @@ -37,6 +37,7 @@ import { LoadingService } from '@services/loading.service'; import { stampPDFPage } from '../../../../utils/page-stamper'; import { TranslateService } from '@ngx-translate/core'; import { AutoUnsubscribeComponent } from '@shared/base/auto-unsubscribe.component'; +import { fileStatusTranslations } from '../../translations/file-status-translations'; const ALL_HOTKEY_ARRAY = ['Escape', 'F', 'f']; @@ -64,10 +65,10 @@ export class FilePreviewScreenComponent extends AutoUnsubscribeComponent impleme viewDocumentInfo = false; excludePages = false; @ViewChild(PdfViewerComponent) viewerComponent: PdfViewerComponent; + translations = fileStatusTranslations; private _instance: WebViewerInstance; private _lastPage: string; private _reloadFileOnReanalysis = false; - @ViewChild('fileWorkloadComponent') private _workloadComponent: FileWorkloadComponent; constructor( diff --git a/apps/red-ui/src/app/modules/dossier/services/dossiers-dialog.service.ts b/apps/red-ui/src/app/modules/dossier/services/dossiers-dialog.service.ts index becdd9247..c4fff7ae9 100644 --- a/apps/red-ui/src/app/modules/dossier/services/dossiers-dialog.service.ts +++ b/apps/red-ui/src/app/modules/dossier/services/dossiers-dialog.service.ts @@ -205,7 +205,7 @@ export class DossiersDialogService extends DialogService { title: _('confirmation-dialog.delete-dossier.title'), titleColor: TitleColors.PRIMARY, question: _('confirmation-dialog.delete-dossier.question'), - // details: _('confirmation-dialog.delete-dossier.details'), + details: _('confirmation-dialog.delete-dossier.details'), confirmationText: _('confirmation-dialog.delete-dossier.confirmation-text'), requireInput: true, denyText: _('confirmation-dialog.delete-dossier.deny-text'), diff --git a/apps/red-ui/src/app/modules/dossier/translations/file-status-translations.ts b/apps/red-ui/src/app/modules/dossier/translations/file-status-translations.ts new file mode 100644 index 000000000..7fd447e6e --- /dev/null +++ b/apps/red-ui/src/app/modules/dossier/translations/file-status-translations.ts @@ -0,0 +1,16 @@ +import { FileStatus } from '@redaction/red-ui-http'; +import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; + +export const fileStatusTranslations: { [key in FileStatus.StatusEnum]: string } = { + APPROVED: _('file-status.approved'), + ERROR: _('file-status.error'), + EXCLUDED: _('file-status.excluded'), + FULLREPROCESS: _('file-status.full-reprocess'), + OCR_PROCESSING: _('file-status.ocr-processing'), + PROCESSING: _('file-status.processing'), + REPROCESS: _('file-status.reprocess'), + UNASSIGNED: _('file-status.unassigned'), + UNDER_APPROVAL: _('file-status.under-approval'), + UNDER_REVIEW: _('file-status.under-review'), + UNPROCESSED: _('file-status.unprocessed') +}; diff --git a/apps/red-ui/src/app/modules/shared/dialogs/confirmation-dialog/confirmation-dialog.component.ts b/apps/red-ui/src/app/modules/shared/dialogs/confirmation-dialog/confirmation-dialog.component.ts index e631566c6..eb5f2ed92 100644 --- a/apps/red-ui/src/app/modules/shared/dialogs/confirmation-dialog/confirmation-dialog.component.ts +++ b/apps/red-ui/src/app/modules/shared/dialogs/confirmation-dialog/confirmation-dialog.component.ts @@ -40,7 +40,6 @@ export class ConfirmationDialogComponent { config: ConfirmationDialogInput; inputValue = ''; readonly inputLabel: string; - private readonly _inputLabelKey = 'confirmation-dialog.delete-dossier.input-label'; constructor( private readonly _dialogRef: MatDialogRef, @@ -49,7 +48,7 @@ export class ConfirmationDialogComponent { ) { this.config = _confirmationDialogInput ?? new ConfirmationDialogInput(); this.config = this.translate(this.config); - this.inputLabel = this.translate(this._inputLabelKey) + ` '${this.config.confirmationText}'`; + this.inputLabel = this.translate('confirmation-dialog.delete-dossier.input-label') + ` '${this.config.confirmationText}'`; } get isDeleteAction() { diff --git a/apps/red-ui/src/app/services/translate-chart.service.ts b/apps/red-ui/src/app/services/translate-chart.service.ts index d2930ebaa..3056f1d6b 100644 --- a/apps/red-ui/src/app/services/translate-chart.service.ts +++ b/apps/red-ui/src/app/services/translate-chart.service.ts @@ -7,8 +7,6 @@ import { rolesTranslations } from '../translations/roles-translations'; providedIn: 'root' }) export class TranslateChartService { - translations = rolesTranslations; - constructor(private readonly _translateService: TranslateService) {} translateStatus(config: DoughnutChartConfig[]): DoughnutChartConfig[] { @@ -18,7 +16,7 @@ export class TranslateChartService { translateRoles(config: DoughnutChartConfig[]): DoughnutChartConfig[] { return config.map(val => ({ ...val, - label: this._translateService.instant(this.translations[val.label]).toLowerCase() + label: this._translateService.instant(rolesTranslations[val.label]).toLowerCase() })); } } diff --git a/apps/red-ui/src/assets/i18n/en.json b/apps/red-ui/src/assets/i18n/en.json index fa4c2bc2a..2039247b8 100644 --- a/apps/red-ui/src/assets/i18n/en.json +++ b/apps/red-ui/src/assets/i18n/en.json @@ -233,8 +233,6 @@ "suggestion-remove-dictionary": "Suggested dictionary removal" }, "annotations": "Annotations", - "app-name": "DDA-R", - "APPROVED": "Approved", "archived": "Archived", "assign-dossier-owner": { "dialog": { @@ -318,7 +316,6 @@ "comment": "Comment", "comments": { "add-comment": "Enter comment", - "cancel": "Cancel", "comments": "{count} {count, plural, one{comment} other{comments}}", "hide-comments": "Hide comments" }, @@ -807,8 +804,6 @@ "unsaved-changes": "You have unsaved changes. Save or revert before changing the tab." }, "efsa": "EFSA Approval", - "ERROR": "Re-processing required", - "EXCLUDED": "Excluded", "file-attribute-types": { "date": "Date", "number": "Number", @@ -969,6 +964,19 @@ }, "unassigned": "Unassigned" }, + "file-status": { + "approved": "Approved", + "error": "Re-processing required", + "excluded": "Excluded", + "full-reprocess": "Processing", + "ocr-processing": "OCR Processing", + "processing": "Processing", + "reprocess": "Processing", + "unassigned": "Unassigned", + "under-approval": "Under Approval", + "under-review": "Under Review", + "unprocessed": "Unprocessed" + }, "filter": { "analysis": "Analysis required", "hint": "Hints only", @@ -995,7 +1003,6 @@ "status": "Status" }, "finished": "Finished", - "FULLREPROCESS": "Processing", "hint": "Hint", "initials-avatar": { "unassigned": "Unassigned", @@ -1072,7 +1079,6 @@ "tomorrow": "Tomorrow", "yesterday": "Yesterday" }, - "OCR_PROCESSING": "OCR Processing", "overwrite-files-dialog": { "options": { "cancel": "Cancel all uploads", @@ -1097,7 +1103,6 @@ }, "pending-analysis": "Pending Re-Analysis", "pending-changes-guard": "WARNING: You have unsaved changes. Press Cancel to go back and save these changes, or OK to lose these changes.", - "PROCESSING": "Processing", "readonly": "Read only", "recategorize-image-dialog": { "actions": { @@ -1149,7 +1154,6 @@ "title": "Reports", "upload-document": "Upload a Document" }, - "REPROCESS": "Processing", "reset-filters": "Reset Filters", "reset-password-dialog": { "actions": { @@ -1239,8 +1243,8 @@ "submitted": "Submitted", "suggestion": "Suggestion for redaction", "time": { - "hours": "{hours} {hours, plural, one{hour} other{hours}}", "days": "{days} {days, plural, one{day} other{days}}", + "hours": "{hours} {hours, plural, one{hour} other{hours}}", "less-than-an-hour": "< 1 hour", "no-time-left": "Time to restore already passed" }, @@ -1293,10 +1297,6 @@ } }, "type": "Type", - "UNASSIGNED": "Unassigned", - "UNDER_APPROVAL": "Under Approval", - "UNDER_REVIEW": "Under Review", - "UNPROCESSED": "Unprocessed", "upload-status": { "dialog": { "actions": { diff --git a/apps/red-ui/src/assets/i18n/te.json b/apps/red-ui/src/assets/i18n/te.json index d36837b91..f8e4417e8 100644 --- a/apps/red-ui/src/assets/i18n/te.json +++ b/apps/red-ui/src/assets/i18n/te.json @@ -4,6 +4,7 @@ "all": "", "none": "" }, + "active": "", "add-dossier-dialog": { "actions": { "save": "", @@ -230,6 +231,7 @@ "suggestion-remove-dictionary": "" }, "annotations": "", + "archived": "", "assign-dossier-owner": { "dialog": { "approvers": "", @@ -349,6 +351,7 @@ "delete-dossier": { "confirmation-text": "", "deny-text": "", + "details": "", "question": "", "title": "" }, @@ -885,6 +888,19 @@ } } }, + "file-status": { + "approved": "", + "error": "", + "excluded": "", + "full-reprocess": "", + "ocr-processing": "", + "processing": "", + "reprocess": "", + "unassigned": "", + "under-approval": "", + "under-review": "", + "unprocessed": "" + }, "filter-menu": { "filter-options": "", "filter-types": "",