Skip to content

Show a singular form in the partial Mod update toast - #803

Merged
Zaldaryon merged 4 commits into
devfrom
fix/issue-753-mods-updated-singular
Nov 11, 2026
Merged

Zaldaryon merged 4 commits into
devfrom
fix/issue-753-mods-updated-singular

Conversation

@Pixnop

@Pixnop Pixnop commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

When an Update all run only half worked, the toast read "1 Mods updated, 1 left as they were". The sentence had no singular form.

The sentence now keeps its single key, features.mods.modsPartiallyUpdated, and is built from two parts: {{updatedPart}}, {{leftPart}}. plus the usual line about the summary. Each part is a new plural family, modsUpdatedCount and modsLeftUnchangedCount. So 1 and 1 reads "1 Mod updated, 1 left as it was." and 2 and 3 reads "2 Mods updated, 3 left as they were." French gets _one, _many and _other for both, like modsCount. The code change is in useBulkUpdateMods.ts.

I did not turn modsPartiallyUpdated itself into a plural family. When an existing key becomes a plural family in en-US, Weblate rewrites the twelve other locale files. It moves each old sentence into _one and writes the other forms as empty strings (#680). Those languages would then show the English sentence for most counts until someone retranslates. With two new keys, no existing key changes shape, and every language keeps its full sentence. The hook still passes updated and failed for them. Only en-US and fr-FR gain the agreement for now, and the other languages follow when translators add the two new families.

The parity test now accepts the old {{updated}} and {{failed}} placeholders on this one key, so those sentences are not flagged. docs/contribute/translation-status.md is regenerated. #793, #794 and #797 add locale keys too, so whichever of these merges later has to regenerate that page after its rebase.

The "Mod(s) now have two versions" toast has the same flaw, but it is outside this issue and I left it alone.

Type

  • Bug fix
  • Feature
  • Performance
  • Refactor or cleanup
  • Tests only
  • Docs or build

Checklist

  • Targets dev, not main.
  • npm run typecheck passes.
  • npm run lint:ci passes.
  • npm run format:check passes.
  • npm run test:coverage passes, coverage at or above the floor in vitest.config.ts.
  • npm run build:unpack passes.

Testing

tests/renderer-dom/useBulkUpdateMods.test.tsx drives the hook against the real i18n resources. It checks 1/1, 1/2, 2/1 and 2/2 in English and in French. It also checks that de-DE still shows its own German sentence for 1/1 and 2/3. On dev the English and French cases with a singular form fail, six in all. The de-DE cases and the plural-only cases pass on both.

I updated the existing assertions in manageMods.test.tsx and manageModsHealth.test.tsx that matched the old partial sentence.

Full run: 306 test files, 5980 passed and 4 skipped. Coverage is 95.11% statements, 91.35% branches, 95.91% functions and 97.05% lines. Typecheck and format are clean, and lint has 0 errors. Regenerating the translation status leaves no diff. I merged dev in after #798 landed, and merged it again after #793 and #797 landed, regenerating the translation status page. The only conflict was the if / else chain in useBulkUpdateMods.ts: I kept dev's shape and put the singular toast parts into the partial branch, and the removed startup notice block did not come back. I did not run npm run build:unpack, the packaged build is left to CI.

Related issues

Fixes #753

@Pixnop
Pixnop requested a review from Zaldaryon November 10, 2026 21:36
@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Translation status

en-US is the source and carries 966 keys.

Locale Keys Missing Stale To review on Weblate
be-BY 882 123 0 Needs editing
de-DE 855 111 0 Needs editing
es-ES 882 123 0 Needs editing
fr-FR 1005 0 0 Needs editing
hu-HU 855 111 0 Needs editing
it-IT 882 123 0 Needs editing
nl-NL 855 111 0 Needs editing
pl-PL 882 123 0 Needs editing
pt-BR 883 122 0 Needs editing
pt-PT 882 123 0 Needs editing
ru-RU 996 11 2 Needs editing
uk-UA 882 123 0 Needs editing
zh-CN 828 99 0 Needs editing

The links open the strings Weblate marks Needs editing for each language: the machine drafts made before Weblate, plus any string whose English changed since it was translated. See #496.

useBulkUpdateMods.ts: kept dev's braced first branch and put our singular toast parts in the failed > 0 branch; nothing of the removed startup-notice block returns.
manageMods.test.tsx merged cleanly: dev's new tests stay and our singular sentence expectation is unchanged.
Pixnop and others added 2 commits November 11, 2026 01:23
The translation status page was regenerated after the merge.

@Zaldaryon Zaldaryon left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The conflict resolution preserves the generated translation status, and the changed source keeps the plural toast behavior focused. Local typecheck, lint, format checks, and 149 targeted tests pass. Required CI checks are green on this head.

@Zaldaryon
Zaldaryon merged commit 8e293f0 into dev Nov 11, 2026
13 checks passed
@Zaldaryon
Zaldaryon deleted the fix/issue-753-mods-updated-singular branch November 11, 2026 10:42
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.

2 participants