Skip to content

fix(web): singular and plural forms in page summaries - #399

Merged
samuelmbabhazi merged 1 commit into
mainfrom
fix/overview-plurals
Nov 21, 2026
Merged

samuelmbabhazi merged 1 commit into
mainfrom
fix/overview-plurals

Conversation

@samuelmbabhazi

@samuelmbabhazi samuelmbabhazi commented Nov 21, 2026 •

Copy link
Copy Markdown
Collaborator

What

  • I18n.count(n, one, other) picks the singular or plural source text with Intl.PluralRules for the interface language, then translates it. An unknown count shows a dash with the plural form.
  • The Overview subtitle ("1 project · 1 environment · 0 servers") and the Organization subtitle ("Organization · 1 member · 3 projects") use it. French gets "0 projet" and "1 serveur", since French counts zero as singular.
  • The French keys follow: the two combined keys are replaced by per-count keys.

Why

The lab screenshots showed "1 projets · 1 environnements · 1 serveurs". The same pattern was wrong in English ("1 projects").

How it was tested

  • I18n.count unit test in English and French (0, 1, 2, unknown).
  • Overview screen test for the exact subtitle.
  • web:lint and web:test (230) pass.

Security considerations

Text only.

Summary by CodeRabbit

  • New Features
    • Added singular and plural count formatting that adapts to the selected language.
    • Organization and dashboard summaries now display localized project, environment, server, and member counts.
    • Missing counts are shown as a dash.
  • Tests
    • Added coverage for count formatting in English and French, including missing counts and dashboard summaries.

The Overview and Organization summaries wrote "1 projects" and
"1 members". I18n.count picks each count's form with the language's
plural rules (French counts zero as singular), and both summaries use
it.

Signed-off-by: samuel mbabhazi <[email protected]>
@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The change adds localized count formatting for singular, plural, and null values. Dashboard and organization summaries use the formatter to display count labels, with tests covering formatter output and an organization overview subtitle.

Changes: Localized summaries

Layer / File(s) Summary
Localized count formatting
apps/web/src/app/ui/i18n.ts, apps/web/src/app/ui/fr.ts, apps/web/src/app/ui/i18n.spec.ts
I18n.count selects singular or plural text using the active language’s plural rules and displays an em dash for null counts. French count translations and formatter tests are added.
Dashboard and organization summaries
apps/web/src/app/dashboard/overview-page.ts, apps/web/src/app/dashboard/overview-page.html, apps/web/src/app/workspace/organization-page.ts, apps/web/src/app/workspace/organization-overview.spec.ts
The dashboard and organization summaries use localized count labels joined by middle dots. The organization overview test checks the rendered subtitle.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: Minimal · up to 10237

This change corrects singular and plural wording in the Overview and Organization summaries, including French zero-count handling. It affects display text only and is easy to revert. No concrete merge risk was identified.

Security architecture risk: Minimal · up to 10237

The changes affect how existing counts are displayed. No introduced or worsened risk to access controls, data ownership, failure containment, or rollback was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "fix(web): singular and plural forms in page summaries" matches the main change. The PR adds I18n.count(n, one, other), which picks singular or plural text by Intl.PluralRules. It uses this …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "fix(web): singular and plural forms in page summaries" matches the main change. The PR adds I18n.count(n, one, other), which picks singular or plural text by Intl.PluralRules. It uses this helper in the Overview and Organization subtitles and updates the French translation keys to per-count keys. The title is specific, short, and states the primary change.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 81c9b47 and 1023741.

Files selected for processing: 7

  • apps/web/src/app/dashboard/overview-page.html
  • apps/web/src/app/dashboard/overview-page.ts
  • apps/web/src/app/ui/fr.ts
  • apps/web/src/app/ui/i18n.spec.ts
  • apps/web/src/app/ui/i18n.ts
  • apps/web/src/app/workspace/organization-overview.spec.ts
  • apps/web/src/app/workspace/organization-page.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.

@samuelmbabhazi
samuelmbabhazi merged commit 7b8f547 into main Nov 21, 2026
24 checks passed
@samuelmbabhazi
samuelmbabhazi deleted the fix/overview-plurals branch November 21, 2026 10:22
samuelmbabhazi added a commit that referenced this pull request Nov 21, 2026
## What

- A `count` pipe (`{{ n | count: '{n} environment' : '{n} environments'
}}`) uses `I18n.count`, which now accepts extra values. The form follows
the interface language's plural rules (`Intl.PluralRules`).
- Every remaining count in the interface uses it:
  - the applications list ("8 applications in 1 environment");
  - the projects cards and the project page;
- the connected agents, in the header and on the Overview (French "0
agent connecté");
  - the recovery codes left;
  - the members note on the Organization page;
  - the replicas running ("0 of 1 replica running").
- The French texts follow: singular forms are added, and two combined
keys are replaced by per-count keys.

## Why

The demo recording showed "8 applications in 1 environments". #399 fixed
the Overview and Organization summaries; this fixes the rest, found by
searching every `{n} …s` text. The certificate countdown is left as it
is: it only says "{n} days" for 2 days or more.

## How it was tested

- Pipe unit test: English singular with extra values, unknown count,
French zero.
- The application screen test now expects "0 of 1 replica running".
- `web:lint` and `web:test` (237) pass.

## Security considerations

Text only.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **Improvements**
* Count labels across the dashboard, projects, applications,
environments, replicas, members, and recovery codes now use singular or
plural wording that matches the displayed count.
* Unknown counts display an em dash, and replica summaries retain both
running and total counts.
  * French translations have been updated for the revised count labels.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Signed-off-by: samuel mbabhazi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant