Repository navigation
Show a singular form in the partial Mod update toast - #803
Merged
Merged
Conversation
Translation statusen-US is the source and carries 966 keys.
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. |
1 task done
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.
This was referenced Nov 10, 2026
The translation status page was regenerated after the merge.
Zaldaryon
approved these changes
Nov 11, 2026
Zaldaryon
left a comment
Collaborator
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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,modsUpdatedCountandmodsLeftUnchangedCount. 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,_manyand_otherfor both, likemodsCount. The code change is inuseBulkUpdateMods.ts.I did not turn
modsPartiallyUpdateditself 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_oneand 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 passesupdatedandfailedfor 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.mdis 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
Checklist
dev, notmain.npm run typecheckpasses.npm run lint:cipasses.npm run format:checkpasses.npm run test:coveragepasses, coverage at or above the floor invitest.config.ts.npm run build:unpackpasses.Testing
tests/renderer-dom/useBulkUpdateMods.test.tsxdrives 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. Ondevthe 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.tsxandmanageModsHealth.test.tsxthat 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
devin 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 inuseBulkUpdateMods.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 runnpm run build:unpack, the packaged build is left to CI.Related issues
Fixes #753