Repository navigation
fix(web): singular and plural forms in page summaries - #399
Conversation
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]>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
## 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]>
What
I18n.count(n, one, other)picks the singular or plural source text withIntl.PluralRulesfor the interface language, then translates it. An unknown count shows a dash with the plural form.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.countunit test in English and French (0, 1, 2, unknown).web:lintandweb:test(230) pass.Security considerations
Text only.
Summary by CodeRabbit