From ab98be198ad65b13df3ebdd53a06776d7dc04a4d Mon Sep 17 00:00:00 2001 From: tutn Date: Wed, 28 Aug 2024 16:53:52 +0700 Subject: [PATCH] Update translate --- .../product-detail/product-detail.component.html | 2 +- .../product-detail/product-detail.component.ts | 2 ++ .../product-filter/product-filter.component.html | 4 ++-- .../src/app/shared/pipes/product-type.pipe.ts | 11 +++++++++++ marketplace-ui/src/assets/i18n/de.yaml | 6 +++--- 5 files changed, 19 insertions(+), 6 deletions(-) create mode 100644 marketplace-ui/src/app/shared/pipes/product-type.pipe.ts diff --git a/marketplace-ui/src/app/modules/product/product-detail/product-detail.component.html b/marketplace-ui/src/app/modules/product/product-detail/product-detail.component.html index 99dd292cd..f91a1040e 100644 --- a/marketplace-ui/src/app/modules/product/product-detail/product-detail.component.html +++ b/marketplace-ui/src/app/modules/product/product-detail/product-detail.component.html @@ -58,7 +58,7 @@

- {{ productDetail().type }} + {{ productDetail().type | productType | translate }}

diff --git a/marketplace-ui/src/app/modules/product/product-detail/product-detail.component.ts b/marketplace-ui/src/app/modules/product/product-detail/product-detail.component.ts index 20a79379e..e4094809d 100644 --- a/marketplace-ui/src/app/modules/product/product-detail/product-detail.component.ts +++ b/marketplace-ui/src/app/modules/product/product-detail/product-detail.component.ts @@ -35,6 +35,7 @@ import { RoutingQueryParamService } from '../../../shared/services/routing.query import { CommonDropdownComponent } from '../../../shared/components/common-dropdown/common-dropdown.component'; import { CommonUtils } from '../../../shared/utils/common.utils'; import { ItemDropdown } from '../../../shared/models/item-dropdown.model'; +import { ProductTypePipe } from '../../../shared/pipes/product-type.pipe'; export interface DetailTab { activeClass: string; @@ -58,6 +59,7 @@ const DEFAULT_ACTIVE_TAB = 'description'; ProductDetailMavenContentComponent, NgbNavModule, MultilingualismPipe, + ProductTypePipe, ProductDetailFeedbackComponent, ProductInstallationCountActionComponent, ProductTypeIconPipe, diff --git a/marketplace-ui/src/app/modules/product/product-filter/product-filter.component.html b/marketplace-ui/src/app/modules/product/product-filter/product-filter.component.html index 5338fb5ae..bc9125742 100644 --- a/marketplace-ui/src/app/modules/product/product-filter/product-filter.component.html +++ b/marketplace-ui/src/app/modules/product/product-filter/product-filter.component.html @@ -10,9 +10,9 @@ 'border-light text-light': themeService.isDarkMode(), 'border-dark text-dark': !themeService.isDarkMode(), 'bg-light text-dark': - selectedTypeLabel === type.value && themeService.isDarkMode(), + selectedTypeLabel === type.label && themeService.isDarkMode(), 'bg-primary border-0 text-light': - selectedTypeLabel === type.value && !themeService.isDarkMode() + selectedTypeLabel === type.label && !themeService.isDarkMode() }">

{{ type.label | translate }} diff --git a/marketplace-ui/src/app/shared/pipes/product-type.pipe.ts b/marketplace-ui/src/app/shared/pipes/product-type.pipe.ts new file mode 100644 index 000000000..7c922ba25 --- /dev/null +++ b/marketplace-ui/src/app/shared/pipes/product-type.pipe.ts @@ -0,0 +1,11 @@ +import { Pipe, PipeTransform } from '@angular/core'; + +@Pipe({ + standalone: true, + name: 'productType' +}) +export class ProductTypePipe implements PipeTransform { + transform(type: string, _args?: []): string { + return `common.filter.value.${type}`; + } +} diff --git a/marketplace-ui/src/assets/i18n/de.yaml b/marketplace-ui/src/assets/i18n/de.yaml index 2fd8fd53e..1f34a9394 100644 --- a/marketplace-ui/src/assets/i18n/de.yaml +++ b/marketplace-ui/src/assets/i18n/de.yaml @@ -19,8 +19,8 @@ common: label: Filter value: allTypes: Alle - connector: Konnektoren - util: Utilities + connector: Konnektor + util: Nützliches demos: Demos solution: Lösungen sort: @@ -102,4 +102,4 @@ common: noFeedbackMessage1: Es gibt noch keine Rückmeldungen für diesen Anschluss. noFeedbackMessage2: Seien Sie der Erste, der seine Meinung mitteilt. rateFeedbackBtnLabel: Diesen Stecker bewerten - reviewLabelNoYet: Noch keine Bewertungen + reviewLabelNoYet: Noch keine Bewertungen \ No newline at end of file