From f8b66d4df382d1847972859838919675d29ea529 Mon Sep 17 00:00:00 2001 From: msutya Date: Mon, 15 Jun 2026 11:17:43 +0200 Subject: [PATCH 1/4] QREPO-413 add extra column to full-item-page in qulto theme and all other themes that inherit it --- .../full/full-item-page.component.html | 3 +- .../full/full-item-page.component.ts | 44 ++++++++++++++++++- .../full/full-item-page.component.html | 8 ++-- .../full/full-item-page.component.ts | 44 ++++++++++++++++++- 4 files changed, 90 insertions(+), 9 deletions(-) diff --git a/src/themes/qulto/app/item-page/full/full-item-page.component.html b/src/themes/qulto/app/item-page/full/full-item-page.component.html index bec88b6892b..99882105db8 100644 --- a/src/themes/qulto/app/item-page/full/full-item-page.component.html +++ b/src/themes/qulto/app/item-page/full/full-item-page.component.html @@ -30,7 +30,8 @@ @for (mdEntry of (metadata$ | async) | keyvalue; track mdEntry) { @for (mdValue of mdEntry.value; track mdValue) { - {{ mdEntry.key | translate }} + {{ mdEntry.key }} + {{ getTranslation(mdEntry.key) }} {{ mdValue.value }} {{ mdValue.language }} diff --git a/src/themes/qulto/app/item-page/full/full-item-page.component.ts b/src/themes/qulto/app/item-page/full/full-item-page.component.ts index 83b661bc40c..9bd5a7c1178 100644 --- a/src/themes/qulto/app/item-page/full/full-item-page.component.ts +++ b/src/themes/qulto/app/item-page/full/full-item-page.component.ts @@ -1,13 +1,29 @@ import { AsyncPipe, KeyValuePipe, + Location, } from '@angular/common'; import { ChangeDetectionStrategy, Component, + Inject, + PLATFORM_ID, } from '@angular/core'; -import { RouterLink } from '@angular/router'; -import { TranslateModule } from '@ngx-translate/core'; +import { + ActivatedRoute, + Router, + RouterLink, +} from '@angular/router'; +import { NotifyInfoService } from '@dspace/core/coar-notify/notify-info/notify-info.service'; +import { AuthorizationDataService } from '@dspace/core/data/feature-authorization/authorization-data.service'; +import { ItemDataService } from '@dspace/core/data/item-data.service'; +import { SignpostingDataService } from '@dspace/core/data/signposting-data.service'; +import { LinkHeadService } from '@dspace/core/services/link-head.service'; +import { ServerResponseService } from '@dspace/core/services/server-response.service'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; import { ThemedItemAlertsComponent } from '../../../../../app/item-page/alerts/themed-item-alerts.component'; import { CollectionsComponent } from '../../../../../app/item-page/field-components/collections/collections.component'; @@ -55,4 +71,28 @@ import { VarDirective } from '../../../../../app/shared/utils/var.directive'; ], }) export class FullItemPageComponent extends BaseComponent { + constructor( + protected route: ActivatedRoute, + protected router: Router, + protected items: ItemDataService, + protected authorizationService: AuthorizationDataService, + protected _location: Location, + protected responseService: ServerResponseService, + protected signpostingDataService: SignpostingDataService, + protected linkHeadService: LinkHeadService, + protected notifyInfoService: NotifyInfoService, + @Inject(PLATFORM_ID) protected platformId: string, + protected translate: TranslateService, + ) { + super(route, router, items, authorizationService, _location, responseService, signpostingDataService, linkHeadService, notifyInfoService, platformId); + } + + /** + * Returns the translation for the given key, or an empty string if no translation exists. + * @param key The metadata key to translate. + */ + getTranslation(key: string): string { + const translation = this.translate.instant(key); + return translation === key ? '' : translation; + } } diff --git a/src/themes/szerep/app/item-page/full/full-item-page.component.html b/src/themes/szerep/app/item-page/full/full-item-page.component.html index 0db982bad98..3dbcb7a7cbd 100644 --- a/src/themes/szerep/app/item-page/full/full-item-page.component.html +++ b/src/themes/szerep/app/item-page/full/full-item-page.component.html @@ -24,10 +24,10 @@ @for (mdEntry of (metadata$ | async) | keyvalue; track mdEntry) { @for (mdValue of mdEntry.value; track mdValue) { - - {{ mdEntry.key | translate }} - {{mdValue.value}} - {{mdValue.language}} + {{ mdEntry.key }} + {{ getTranslation(mdEntry.key) }} + {{ mdValue.value }} + {{ mdValue.language }} } } diff --git a/src/themes/szerep/app/item-page/full/full-item-page.component.ts b/src/themes/szerep/app/item-page/full/full-item-page.component.ts index f023d178066..74eaf252f8a 100644 --- a/src/themes/szerep/app/item-page/full/full-item-page.component.ts +++ b/src/themes/szerep/app/item-page/full/full-item-page.component.ts @@ -1,13 +1,29 @@ import { AsyncPipe, KeyValuePipe, + Location, } from '@angular/common'; import { ChangeDetectionStrategy, Component, + Inject, + PLATFORM_ID, } from '@angular/core'; -import { RouterLink } from '@angular/router'; -import { TranslateModule } from '@ngx-translate/core'; +import { + ActivatedRoute, + Router, + RouterLink, +} from '@angular/router'; +import { NotifyInfoService } from '@dspace/core/coar-notify/notify-info/notify-info.service'; +import { AuthorizationDataService } from '@dspace/core/data/feature-authorization/authorization-data.service'; +import { ItemDataService } from '@dspace/core/data/item-data.service'; +import { SignpostingDataService } from '@dspace/core/data/signposting-data.service'; +import { LinkHeadService } from '@dspace/core/services/link-head.service'; +import { ServerResponseService } from '@dspace/core/services/server-response.service'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; import { ThemedItemAlertsComponent } from '../../../../../app/item-page/alerts/themed-item-alerts.component'; import { CollectionsComponent } from '../../../../../app/item-page/field-components/collections/collections.component'; @@ -51,4 +67,28 @@ import { VarDirective } from '../../../../../app/shared/utils/var.directive'; ], }) export class FullItemPageComponent extends BaseComponent { + constructor( + protected route: ActivatedRoute, + protected router: Router, + protected items: ItemDataService, + protected authorizationService: AuthorizationDataService, + protected _location: Location, + protected responseService: ServerResponseService, + protected signpostingDataService: SignpostingDataService, + protected linkHeadService: LinkHeadService, + protected notifyInfoService: NotifyInfoService, + @Inject(PLATFORM_ID) protected platformId: string, + protected translate: TranslateService, + ) { + super(route, router, items, authorizationService, _location, responseService, signpostingDataService, linkHeadService, notifyInfoService, platformId); + } + + /** + * Returns the translation for the given key, or an empty string if no translation exists. + * @param key The metadata key to translate. + */ + getTranslation(key: string): string { + const translation = this.translate.instant(key); + return translation === key ? '' : translation; + } } From 4747cbe78d77fc79c2acc461b1b247344182b1d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kan=C3=A1sz-Nagy=20Zolt=C3=A1n?= Date: Mon, 15 Jun 2026 15:18:19 +0200 Subject: [PATCH 2/4] QREPO-413 add HU/EN labels for traditional metadata fields (qulto) Add dc.* translation keys for the qulto theme i18n (hu/en) so the full-item-page label column shows localised field names. - Keys match the metadata field names (e.g. dc.title); EN reuses the official submission-form