Skip to content

fix(web): pick backup and restore wording for the exact number of items - #4741

Merged
Quick104 merged 4 commits into
mainfrom
fix/backup-restore-count-free-plurals
Nov 22, 2026
Merged

Quick104 merged 4 commits into
mainfrom
fix/backup-restore-count-free-plurals

Conversation

@Quick104

@Quick104 Quick104 commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Related issue: N/A
Validation tasks: none

Other clients: N/A (web admin only: these messages are web-only keys on the Backups and Restore pages, which Apple, Android, and Roku don't have)

In several languages, seven Backups and Restore messages in the web admin read as if there were one item when there are 21, 31, or 101. They choose between "it" and "them" with an ICU plural on a count they never print. CLDR's one category isn't "exactly one": in Russian, Ukrainian, Croatian, Lithuanian, and Latvian it also covers 21, 31, 101, and in Slovenian 101 and 201. This change picks the singular only for exactly one item. English is unchanged.

On main, with the translations pinned there:

  • Backup warning details, for a group of 21 omitted accounts: Russian "21 аккаунт — его данные слишком велики…" ("his data"), and the same in Ukrainian, Croatian, Lithuanian, and Latvian (web.admin.backups.warnings.tooLarge, dataUnreadable, partUnreadable).
  • Restore page, choose step: the toggle for 21 matching items reads "Rādīt to" ("show it") in Latvian and "Prikaži" instead of "Prikaži ih" in Croatian. In Slovenian, 101 does the same (web.admin.backups.restore.choose.showThem / hideThem).
  • Restore page notices after choosing or unchoosing items: Ukrainian "Це потрібно" and Latvian "Tas ir nepieciešams" ("it is needed") for 21 items, and Russian "так как этому нужно" for 21 unchosen items (web.admin.backups.restore.notice.alsoChose / alsoUnchose).

Approach

The seven keys now select on a String {amount} that the caller sets: exactlyOne, exactlyTwo, or other, from a new exactAmount(count) in web/src/i18n. This matches the backup warning toggles (Silo-Server/silo-translations#132, #136). exactlyTwo keeps the dual that Slovenian and Arabic use for exactly two items, which the old plural got right. In English it has the same text as other.

The catalog change is Silo-Server/silo-translations#135, merged and published in release 2026.11.21-b2f2d7a, which this branch pins. The backup warning toggles from #4737 now use the shared exactAmount in place of their file-local copy.

docs/architecture/i18n.md and web/src/i18n/README.md gain the rule: a plural is for words that agree with the number printed beside them. Words that refer to the items as one or several ("it"/"them", "its"/"their") select on the exact amount in new or changed web-only messages. The rule names older web messages and native keys, which have no select, as still using plural. Other web messages outside Backups have the same problem; #4743 tracks them.

Validation

  • Ran the real groupOmissions and chooseItems against the real ru, uk, hr, lt, lv, and sl catalogs at 1, 2, 5, 21, and 101 items. 18 of 25 cases failed on main and all pass with this change. The script is not committed, because CONTRIBUTING rules out tests for wording.
  • The same script passes on the published release 2026.11.21-b2f2d7a after the re-pin.
  • Web typecheck, eslint and prettier on the changed files, and the Backups and i18n vitest suites pass.
  • silo-translations make check and make check-complete pass on API v2 program epic: /api/v2 contract reset on Huma, bounded bridge, v1 retirement at 1.0 #135.

Evidence

Evidence: https://evidence.siloserver.org/r/silo-server/pr-4741/

Surface and build: web admin Restore page (choose step) and backup warning details. Before is main at ba62a27 with the pinned translations; after is this branch with #135's catalog. Captured at desktop and iPhone widths in Croatian, Latvian, Lithuanian, Russian, Ukrainian, and Slovenian (21 or 101 items), Slovenian and Arabic at 2, and English at 1 and 21. No test server was available, so the captures come from a temporary local route that renders the real RestoreChoose page with a seeded restore set. That route is not part of this change.

Risks

The placeholder changes from count to amount. A build that pairs this code with a translations release older than 2026.11.21-b2f2d7a would render these seven messages as format errors; this pull request carries the pin to that release.

Checklist

  • I read and can explain the complete diff.
  • This pull request addresses one concern.
  • Each test this pull request adds meets "Decide what to test" in CONTRIBUTING.md.
  • The Evidence section shows every change a user can see, or how I checked a change nobody sees.

Council review

Rounds: 2, last reviewed 1a6ae26

Member Round 1 Round 2
Sol (gpt-6.2-sol, xhigh) 9/10 9/10
Opus (claude-opus-5-5, high) 9/10 9/10
Gemini (gemini-4-neon, xhigh) unavailable 9/10

Visual review: 1 round, captures of the code in 1b54186

Member Round 1
Sol better, 8/10
Opus better, 8/10
Gemini better, 9/10

Round 1 fixed: none needed. Answered: Sol's one finding, web.admin.backups.restore.nothing.allMatch, predates this change and moved to #4743. Gemini hit its quota limit on the first run and on the retry, and posted nothing.

Round 2 (maintainer review, after merging main): fixed the docs/architecture/i18n.md rule's wording about older web messages and its incomplete language lists, in a docs-only commit. Answered: the requests for more tests (exactAmount is already exercised through the backup warning toggle tests, and the restore notices run in restoreModel.test.ts, where a missing value throws). Left for the maintainers: the Lithuanian alsoUnchose wording, which predates this change.

AI Disclosure

  • Harness: Claude Code in T3 Code
  • Tool(s): Claude Code; T3 Code delegate tasks to OpenAI Codex and Google Antigravity
  • Model(s): claude-opus-5-5 (implementation); gpt-6.2-sol, claude-opus-5-5, gemini-4-neon (plan, visual, and pull request reviews); claude-sonnet-5-5 (code-review subagents)
  • Involvement: Fully AI-generated; not yet human verified
  • Adversarial review: three models reviewed the plan (they added alsoUnchose, the exactlyTwo branch, and the catalog merge order), the captures, and the pull request; see Council review. A multi-agent code review asked for the web i18n README update and the release re-pin.

🤖 Generated with Claude Code

Note

Use exact-count amount selectors for backup and restore item wording

  • Adds an exactAmount utility in format.ts that maps counts to exactlyOne, exactlyTwo, or other, so messages pick wording for the exact number of items instead of CLDR plural categories.
  • Backup and restore components in BackupWarningDetails.tsx, RestoreChoose.tsx, restoreModel.ts, and warningDetails.ts now pass amount: exactAmount(count) instead of a numeric count.
  • All locale catalogs (English and translations) are updated: the seven affected messages switch from count plurals to amount selects, and new translations are added for the backup missing-file warning keys and the goToPage/pastEnd request-pagination messages.
  • Documents the pattern in i18n.md and README.md.
  • Risk: the affected messages no longer accept count-based plural values; unconverted callers passing only count would miss the exact-amount branches.

Macroscope summarized 4492f0a.

Seven backup and restore messages in the web admin chose "it" or "them"
with a plural on a count they never print. In Russian, Ukrainian,
Croatian, Lithuanian and Latvian CLDR's "one" form also covers 21, 31 or
101, and in Slovenian 101, so 21 omitted accounts read "its data is too
large" and the Restore page offered "Show it" for 21 items. The callers
now pass exactAmount(count), and the catalog selects on exactlyOne,
exactlyTwo (for the Slovenian and Arabic dual) or other. English is
unchanged.

docs/architecture/i18n.md and the web i18n README now say when a web
message selects on the exact amount instead of a plural.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@silo-triage silo-triage Bot added the size/XXXL 3000+ added + deleted lines (all files); change volume, not priority. label Nov 21, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-22T00:06:34.496439Z 4492f0a New commits
🔒 Security Review ✅ Completed 2026-11-22T00:08:33.852259Z 4492f0a New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

  • Ask an admin to enable usage-based reviews

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Next included review available in 4 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5259462a-db9d-4c3f-b215-16f81d556440
Commits

Reviewing files that changed from the base of the PR and between e4073c5 and 4492f0a.

Files selected for processing: 51

  • .silo-translations
  • docs/architecture/i18n.md
  • web/src/i18n/README.md
  • web/src/i18n/format.ts
  • web/src/i18n/index.ts
  • web/src/locales/ar-XB.json
  • web/src/locales/ar.json
  • web/src/locales/bg.json
  • web/src/locales/ca.json
  • web/src/locales/cs.json
  • web/src/locales/da.json
  • web/src/locales/de.json
  • web/src/locales/el.json
  • web/src/locales/en-XA.json
  • web/src/locales/en.json
  • web/src/locales/es.json
  • web/src/locales/et.json
  • web/src/locales/fi.json
  • web/src/locales/fr.json
  • web/src/locales/he.json
  • web/src/locales/hi.json
  • web/src/locales/hr.json
  • web/src/locales/hu.json
  • web/src/locales/id.json
  • web/src/locales/it.json
  • web/src/locales/ja.json
  • web/src/locales/keys.ts
  • web/src/locales/ko.json
  • web/src/locales/lt.json
  • web/src/locales/lv.json
  • web/src/locales/ms.json
  • web/src/locales/nb.json
  • web/src/locales/nl.json
  • web/src/locales/pl.json
  • web/src/locales/pt-BR.json
  • web/src/locales/pt-PT.json
  • web/src/locales/ro.json
  • web/src/locales/ru.json
  • web/src/locales/sk.json
  • web/src/locales/sl.json
  • web/src/locales/sv.json
  • web/src/locales/th.json
  • web/src/locales/tr.json
  • web/src/locales/uk.json
  • web/src/locales/vi.json
  • web/src/locales/zh-Hans.json
  • web/src/locales/zh-Hant.json
  • web/src/pages/admin-backups/BackupWarningDetails.tsx
  • web/src/pages/admin-backups/RestoreChoose.tsx
  • web/src/pages/admin-backups/restoreModel.ts
  • web/src/pages/admin-backups/warningDetails.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@silo-kody

silo-kody Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

Comment thread .silo-translations Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1b541863c9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .silo-translations Resolved
@silo-triage silo-triage Bot added bug Something isn't working impact: polish Annoyance, cosmetic, or nice-to-have javascript Pull requests that update javascript code priority: P2 Limited scope, workaround exists, or polish labels Nov 21, 2026
Re-pin web translations to silo-translations 2026.11.21-b2f2d7a, which
includes Silo-Server/silo-translations#135, and have the backup warning
toggles use the shared exactAmount() from @/i18n.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@Quick104 Quick104 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review of 1a6ae26 (main merged in). The code change holds up. Every caller of the seven keys passes amount, all 41 web catalogs select on amount with all three cases, the pinned release only adds keys, and rendering the real ru, lv and sl catalogs shows the plural wording at 21 and 101 and the singular kept for exactly one. One docs finding is below.

🤖 Claude Code (claude-opus-5-5)

Comment thread docs/architecture/i18n.md Resolved
…here one is not exactly one

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@silo-kody

silo-kody Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Code Review Completed, but its comments could not be posted ⚠️

The review produced 2 comment(s), but none could be posted to this pull request (for example, the platform rejected them with a rate limit). This is not a clean review: comment @kody review on this PR to run it again.

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Validate Business Logic: Ask Kody to validate your code against business rules by adding a comment with the @kody -v business-logic command.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

Access your configuration settings here.

​

@Quick104

Copy link
Copy Markdown
Contributor Author

Maintainer review summary

Reviewed head: 4492f0a (code reviewed at 1a6ae26; the last commit only changes docs)

Fit: 9/10 · Readiness: 9/10 — ready (assuming CI is green)

  • Fit: this fixes wrong wording for languages the web admin already ships. It adds no setting or API, it changes nothing for clients, and it replaces a file-local helper with one shared helper.
  • Readiness: the change works as described, and nothing substantive is left.

What changed in this review

  • Merged main into the branch. One import conflict in RestoreChoose.tsx needed resolving. I re-ran scripts/sync-translations --version 2026.11.21-b2f2d7a, and the generated files came out unchanged.
  • 4492f0a rewrites the new rule in docs/architecture/i18n.md. It now says native keys can't use select and that older web messages haven't been converted yet, instead of implying they can't. It also names 0 in French, Brazilian Portuguese and Hindi as falling in one, and describes exactlyTwo as keeping the dual of languages that have one. The thread is resolved.

How it was checked

  • I rendered the seven messages from the real ru, lv and sl catalogs with intl-messageformat 12.1.4 at 1, 2, 21 and 101 items, on main and on this branch. On main, 21 and 101 get singular wording, for example Latvian showThem at 21 is "Rādīt to" and Russian tooLarge at 21 is "его данные". On this branch they get plural wording ("Rādīt tos", "их данные"). Exactly one stays singular, and Slovenian keeps its dual at 2.
  • All 41 web catalogs have the seven keys as a select on amount with exactlyOne, exactlyTwo and other, and none of them still uses count. The re-pin from 2026.11.21-0719c45 to b2f2d7a removes no keys. It changes only these seven messages and adds 12 keys that nothing uses yet.
  • Every caller passes amount: exactAmount(n), including the English clipboard report.
  • Web typecheck, eslint, prettier, and the admin-backups and i18n vitest suites (55 tests) pass.
  • I swapped count back in for amount in the two restore notices, and 6 tests in restoreModel.test.ts failed. A stray count there would fail CI. This PR adds no tests, so I ran none against the base.

Council (round 2, on 1a6ae26)

Member Score
Sol (gpt-6.2-sol, xhigh) 9/10
Opus (claude-opus-5-5, high) 9/10
Gemini (gemini-4-neon, xhigh) 9/10

The docs wording finding (Opus, plus a code-review finder) is fixed. The suggestions to add more tests are answered: the backup warning toggle tests already cover exactAmount's 1/2/many split, and the mutation check above shows the restore notice tests catch a stray count. Making the arguments type-checked per key, or adding a catalog check for a plural that prints no number, would be follow-ups; #4743 already suggests the catalog check.

Left for the maintainers

  • Lithuanian web.admin.backups.restore.notice.alsoUnchose has the same text in all three branches ("nes tam reikia to, ko atsisakėte"). The alsoChose plural branches switch to "jų". This predates the PR: main has the same text in every plural form. Whether "tam" reads as singular there needs a Lithuanian speaker.

Other checks

  • Validated features: not run. This review's GitHub token lacks the read:project scope the validation board needs.
  • User manual: unaffected. The siloserver.org docs don't cover translated wording on these pages.
  • Apple/Android parity: not applicable. These are web-only keys.
  • Translations: fix(catalog): pick backup and restore wording for the exact number of items silo-translations#135 is merged, and its release 2026.11.21-b2f2d7a is pinned here.
  • Evidence: the published page shows the wording change captured on 1b54186. That wording is unchanged at this head, so the page wasn't republished.

🤖 Claude Code (claude-opus-5-5)

@Quick104
Quick104 merged commit 5641447 into main Nov 22, 2026
20 checks passed
@Quick104
Quick104 deleted the fix/backup-restore-count-free-plurals branch November 22, 2026 00:18
Quick104 added a commit that referenced this pull request Nov 22, 2026
#4741 was squash-merged into main as 5641447, so this branch's copies of
its commits are resolved to main's versions. The web stays pinned to
silo-translations 2026.11.21-06af3eb, which builds on main's b2f2d7a;
the diff against main is now only this PR's change.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Quick104 added a commit that referenced this pull request Nov 22, 2026
#4741 landed on main as 5641447, so this drops its original commits from
the branch. Keep the web translations at 2026.11.21-04a2222, which adds
only the three Ambiguous Roots confidence keys to main's
2026.11.21-b2f2d7a.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working impact: polish Annoyance, cosmetic, or nice-to-have javascript Pull requests that update javascript code priority: P2 Limited scope, workaround exists, or polish size/XXXL 3000+ added + deleted lines (all files); change volume, not priority.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant