diff --git a/src/app/features/registry/components/registry-statuses/registry-statuses.component.html b/src/app/features/registry/components/registry-statuses/registry-statuses.component.html index 016932507..6fa7ed144 100644 --- a/src/app/features/registry/components/registry-statuses/registry-statuses.component.html +++ b/src/app/features/registry/components/registry-statuses/registry-statuses.component.html @@ -1,18 +1,15 @@ -

{{ 'registry.overview.statuses.' + registry()?.status + '.text' | translate }}

+

{{ statusTranslations().text | translate }}

-

{{ 'registry.overview.statuses.' + registry()?.status + '.short' | translate }}

+

{{ statusTranslations().short | translate }}

- {{ - 'registry.overview.statuses.' + registry()?.status + '.long' - | translate: { embargoEndDate: embargoEndDate(), email: supportEmail } - }} + {{ statusTranslations().long | translate: { embargoEndDate: embargoEndDate(), email: supportEmail } }} @if (isAccepted()) { diff --git a/src/app/features/registry/components/registry-statuses/registry-statuses.component.ts b/src/app/features/registry/components/registry-statuses/registry-statuses.component.ts index abf8b81e9..b36a67728 100644 --- a/src/app/features/registry/components/registry-statuses/registry-statuses.component.ts +++ b/src/app/features/registry/components/registry-statuses/registry-statuses.component.ts @@ -55,6 +55,23 @@ export class RegistryStatusesComponent { return date ? new Date(date).toDateString() : null; }); + statusTranslations = computed(() => { + const status = this.registry()?.status; + if (!status) { + return { + text: 'registry.overview.endEmbargo', + short: 'registry.overview.endEmbargo', + long: 'registry.overview.endEmbargo', + }; + } + const basePath = `registry.overview.statuses.${status}`; + return { + text: `${basePath}.text`, + short: `${basePath}.short`, + long: `${basePath}.long`, + }; + }); + openWithdrawDialog(): void { const registry = this.registry();