From ec8c13d952c72ef06e30d05c7de36efdee4334dc Mon Sep 17 00:00:00 2001 From: Angelika Kinas Date: Mon, 13 Nov 2023 15:41:49 +0100 Subject: [PATCH 1/2] feat(DH): Improve plurals in text --- .../home/news-page/key-figures/key-figures.component.html | 4 ++-- libs/ui/dataviz/src/lib/figure/figure.component.html | 5 ++++- libs/ui/dataviz/src/lib/ui-dataviz.module.ts | 3 ++- translations/en.json | 4 ++-- translations/fr.json | 4 ++-- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/apps/datahub/src/app/home/news-page/key-figures/key-figures.component.html b/apps/datahub/src/app/home/news-page/key-figures/key-figures.component.html index d04e7eee5f..943dab7b50 100644 --- a/apps/datahub/src/app/home/news-page/key-figures/key-figures.component.html +++ b/apps/datahub/src/app/home/news-page/key-figures/key-figures.component.html @@ -4,7 +4,7 @@ class="py-[37px] pl-[47px] rounded-lg border bg-white mb-5 card-shadow cursor-pointer" [figure]="recordsCount$ | async" [icon]="'folder_open'" - [title]="'catalog.figures.datasets' | translate" + [title]="'catalog.figures.datasets'" [color]="'secondary'" > @@ -13,7 +13,7 @@ class="py-[37px] pl-[47px] rounded-lg bg-white border card-shadow cursor-pointer" [figure]="orgsCount$ | async" [icon]="'corporate_fare'" - [title]="'catalog.figures.organisations' | translate" + [title]="'catalog.figures.organisations'" [color]="'secondary'" > diff --git a/libs/ui/dataviz/src/lib/figure/figure.component.html b/libs/ui/dataviz/src/lib/figure/figure.component.html index 180c9e62cb..7b06c7b37c 100644 --- a/libs/ui/dataviz/src/lib/figure/figure.component.html +++ b/libs/ui/dataviz/src/lib/figure/figure.component.html @@ -1,4 +1,5 @@
@@ -15,6 +16,8 @@ {{ figure }} {{ unit }}
-
{{ title }}
+
+ {{ title }} +
diff --git a/libs/ui/dataviz/src/lib/ui-dataviz.module.ts b/libs/ui/dataviz/src/lib/ui-dataviz.module.ts index 7b52a98feb..a2197e3d2f 100644 --- a/libs/ui/dataviz/src/lib/ui-dataviz.module.ts +++ b/libs/ui/dataviz/src/lib/ui-dataviz.module.ts @@ -2,9 +2,10 @@ import { NgModule } from '@angular/core' import { CommonModule } from '@angular/common' import { FigureComponent } from './figure/figure.component' import { MatIconModule } from '@angular/material/icon' +import { TranslateModule } from '@ngx-translate/core' @NgModule({ - imports: [CommonModule, MatIconModule], + imports: [CommonModule, MatIconModule, TranslateModule.forChild()], declarations: [FigureComponent], exports: [FigureComponent], }) diff --git a/translations/en.json b/translations/en.json index 092c5b1583..f1bbab512c 100644 --- a/translations/en.json +++ b/translations/en.json @@ -1,6 +1,6 @@ { - "catalog.figures.datasets": "datasets", - "catalog.figures.organisations": "organisations", + "catalog.figures.datasets": "{count, plural, =0{datasets} one{dataset} other{datasets}}", + "catalog.figures.organisations": "{count, plural, =0{organisations} one{organisation} other{organisations}}", "chart.aggregation.average": "average", "chart.aggregation.count": "count", "chart.aggregation.max": "max", diff --git a/translations/fr.json b/translations/fr.json index 22d8ae5069..affa0ce039 100644 --- a/translations/fr.json +++ b/translations/fr.json @@ -1,6 +1,6 @@ { - "catalog.figures.datasets": "données", - "catalog.figures.organisations": "organisations", + "catalog.figures.datasets": "{count, plural, =0{données} one{donnée} other{données}}", + "catalog.figures.organisations": "{count, plural, =0{organisations} one{organisation} other{organisations}}", "chart.aggregation.average": "moyenne", "chart.aggregation.count": "nombre", "chart.aggregation.max": "maximum", From 2b3620d4eac52972e20bc9dcef7e52098224f99c Mon Sep 17 00:00:00 2001 From: Angelika Kinas Date: Tue, 14 Nov 2023 16:24:59 +0100 Subject: [PATCH 2/2] feat(DH): Add plural translation for german --- translations/de.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/translations/de.json b/translations/de.json index d4da8d0e2c..8577896e1a 100644 --- a/translations/de.json +++ b/translations/de.json @@ -1,6 +1,6 @@ { - "catalog.figures.datasets": "Datensätze", - "catalog.figures.organisations": "Organisationen", + "catalog.figures.datasets": "{count, plural, =0{Datensätze} one{Datensatz} other{Datensätze}}", + "catalog.figures.organisations": "{count, plural, =0{Organisationen} one{Organisation} other{Organisationen}}", "chart.aggregation.average": "Durchschnitt", "chart.aggregation.count": "Anzahl", "chart.aggregation.max": "Maximum",