Skip to content

Commit

Permalink
feat(DH): Improve plurals in text
Browse files Browse the repository at this point in the history
  • Loading branch information
Angi-Kinas committed Nov 13, 2023
1 parent 5f1c197 commit ec8c13d
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
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/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

0 comments on commit ec8c13d

Please sign in to comment.