diff --git a/src/app/datasets/dataset-detail/dataset-detail-dynamic/dataset-detail-dynamic.component.ts b/src/app/datasets/dataset-detail/dataset-detail-dynamic/dataset-detail-dynamic.component.ts index 394ec88a5..81ee23cb5 100644 --- a/src/app/datasets/dataset-detail/dataset-detail-dynamic/dataset-detail-dynamic.component.ts +++ b/src/app/datasets/dataset-detail/dataset-detail-dynamic/dataset-detail-dynamic.component.ts @@ -73,7 +73,7 @@ export class DatasetDetailDynamicComponent implements OnInit, OnDestroy { private router: Router, private snackBar: MatSnackBar, ) { - this.translateService.use("datasetCustom"); + this.translateService.use("dataset"); } ngOnInit() { diff --git a/src/app/datasets/dataset-detail/dataset-detail/dataset-detail.component.ts b/src/app/datasets/dataset-detail/dataset-detail/dataset-detail.component.ts index 14900885d..995facc8b 100644 --- a/src/app/datasets/dataset-detail/dataset-detail/dataset-detail.component.ts +++ b/src/app/datasets/dataset-detail/dataset-detail/dataset-detail.component.ts @@ -97,7 +97,7 @@ export class DatasetDetailComponent implements OnInit, OnDestroy { private router: Router, private fb: FormBuilder, ) { - this.translateService.use("datasetDefault"); + this.translateService.use("dataset"); } ngOnInit() { diff --git a/src/app/datasets/dataset-table/dataset-table.component.ts b/src/app/datasets/dataset-table/dataset-table.component.ts index 273377e15..23efb288d 100644 --- a/src/app/datasets/dataset-table/dataset-table.component.ts +++ b/src/app/datasets/dataset-table/dataset-table.component.ts @@ -9,7 +9,7 @@ import { } from "@angular/core"; import { TableColumn } from "state-management/models"; import { MatCheckboxChange } from "@angular/material/checkbox"; -import { BehaviorSubject, Subscription, lastValueFrom, take } from "rxjs"; +import { BehaviorSubject, Subscription, forkJoin, lastValueFrom, map, take } from "rxjs"; import { Store } from "@ngrx/store"; import { clearSelectionAction, @@ -64,6 +64,7 @@ import { TitleCasePipe } from "shared/pipes/title-case.pipe"; import { actionMenu } from "shared/modules/dynamic-material-table/utilizes/default-table-settings"; import { TableConfigService } from "shared/services/table-config.service"; import { selectInstruments } from "state-management/selectors/instruments.selectors"; +import { TranslateService } from "@ngx-translate/core"; export interface SortChangeEvent { active: string; @@ -155,7 +156,10 @@ export class DatasetTableComponent implements OnInit, OnDestroy { private fileSize: FileSizePipe, private titleCase: TitleCasePipe, private tableConfigService: TableConfigService, - ) {} + private translateService: TranslateService, + ) { + this.translateService.use("dataset"); + } private getInstrumentName(row: OutputDatasetObsoleteDto): string { const instrument = this.instrumentMap.get(row.instrumentId); @@ -207,6 +211,21 @@ export class DatasetTableComponent implements OnInit, OnDestroy { } this.columns = currentColumnSetting; + const translated$ = forkJoin( + currentColumnSetting.map((i) => + this.translateService.get(i.header || i.name).pipe( + map((translated) => ({ + ...i, + header: translated, + }) + )) + ) + ); + + translated$.subscribe((result) => { + this.columns = result; + }); + this.setting = settingConfig; this.pagination = paginationConfig; }