Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(DH): Improve plurals in text #686

Merged
merged 2 commits into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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'"
></gn-ui-figure>
</a>
Expand All @@ -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'"
></gn-ui-figure>
</a>
Expand Down
5 changes: 4 additions & 1 deletion libs/ui/dataviz/src/lib/figure/figure.component.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<div
translate
class="flex flex-row justify-start items-center overflow-hidden"
[title]="hoverTitle"
>
Expand All @@ -15,6 +16,8 @@
<span class="figure font-medium mr-[0.3em]">{{ figure }}</span>
<span class="unit text-[0.665em]">{{ unit }}</span>
</div>
<div class="title truncate">{{ title }}</div>
<div translate class="title truncate" [translateParams]="{ count: figure }">
{{ title }}
</div>
</div>
</div>
3 changes: 2 additions & 1 deletion libs/ui/dataviz/src/lib/ui-dataviz.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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],
})
Expand Down
4 changes: 2 additions & 2 deletions translations/de.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
4 changes: 2 additions & 2 deletions translations/en.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
4 changes: 2 additions & 2 deletions translations/fr.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
Loading