fix(i18n): tallies of participles read as labels

Texts that count with participles or adjectives still put a bare number in
front of a word that agrees with it in Italian, so one failure read "1 non
riuscite": the import result and its Done toast, the archive health line and
the thumbnail and import job log lines. They now read as labels in English and
Italian ("Copied: 40 · failed: 1"), like the scan and verify log lines; their
old translations leave the other 36 catalogs until the next translation pass.
The uploader's progress keeps the mockup's English and uses labels in Italian,
and the admin dashboard's upload total no longer agrees with the number.

`i18n check` now also fails on an English text that tallies two or more counts
with participles or adjectives. A single "{0} failed" is left alone, since the
placeholder there is as often a name or a size as a count.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
Claude committed 2026-10-12 11:09:17 +00:00
1 parent 4850af2443
commit 082ff1e3eb
84 files changed
+76 -162

No files matched your search

@@ -55,7 +55,16 @@ public sealed class UploaderTextTests
{
Assert.Null(UploaderText.Failed(Mockup, En));
Assert.Equal("1,203 failed", UploaderText.Failed(Mockup with { Failed = 1_203 }, En));
Assert.Equal("3 non riusciti", UploaderText.Failed(Mockup with { Failed = 3 }, It));
// Italian participles agree with the number ("1 non riuscito", "3 non riusciti"): the count follows a label instead.
Assert.Equal("Non riusciti: 3", UploaderText.Failed(Mockup with { Failed = 3 }, It));
Assert.Equal("Non riusciti: 1", UploaderText.Failed(Mockup with { Failed = 1 }, It));
}
[Test]
public void ItalianProgressReadsForASingleFileToo()
{
Assert.Equal("Inviati: 1 di 1 · Verificati dal server: 1 · 0 nuovi tentativi",
UploaderText.ProgressLine(Mockup with { Files = 1, Sent = 1, Verified = 1 }, It));
}
[Test]
@@ -85,7 +85,7 @@ public sealed class ArchiveJobTests(TestContext context)
// A full pass reuses what is current and builds the rest.
var all = await engine.EnqueueAsync(ArchiveJobs.Thumbnails([a.Id]), cancellationToken: fx.Ct);
var done = await fx.WaitForAsync(all.Id, JobState.Done);
Assert.Contains("3 made, 3 reused", done.LogTail);
Assert.Contains("made 3, reused 3", done.LogTail);
}
[Test]
@@ -125,6 +125,6 @@ public sealed class ArchiveJobTests(TestContext context)
var frames = await fx.Db.Frames.ListBySequenceAsync(id);
Assert.SequenceEqual(plan.Items.Skip(32).Select(i => i.FileName), frames.Select(f => f.FileName));
Assert.Equal(8, (await fx.Db.MediaCards.GetImportedKeysAsync(media.Id)).Count);
Assert.Contains("8 copied", done.LogTail);
Assert.Contains("Copied: 8,", done.LogTail);
}
}
@@ -32,4 +32,28 @@ public sealed class I18nCommandTests
Assert.Null(I18nCommand.CountedNoun("Tooltips.Editor.Remote", "Changes are saved on {0} and analyses and renders run there"));
Assert.Null(I18nCommand.CountedNoun("Advisor.Reason.Transition.Single", "A single exposure step: a {0}-frame transition keeps the change gentle."));
}
[Test]
public void ATallyOfParticiplesNeedsLabels()
{
// Italian reads "1 copiate · 1 non riuscite": the participle agrees with the number in front of it.
Assert.Equal("copied", I18nCommand.CountedTally("Import.Result.Partial", "{0} copied · {1} failed"));
Assert.Equal("missing", I18nCommand.CountedTally("Archive.Health.Damaged", "{0} missing · {1} damaged"));
Assert.Equal("made", I18nCommand.CountedTally("Archive.Log.ImagesDone", "{0}: {1} made, {2} reused, {3} unreadable"));
Assert.Equal("copied", I18nCommand.CountedTally("Archive.Log.ImportDone", "{0:N0} copied, {1:N0} skipped, {2:N0} failed."));
}
[Test]
public void LabelsNamesAndSizesAreNoTally()
{
Assert.Null(I18nCommand.CountedTally("Import.Result.Partial", "Copied: {0} · failed: {1}"));
Assert.Null(I18nCommand.CountedTally("Archive.Log.ImagesDone", "{0}: made {1}, reused {2}, unreadable {3}"));
Assert.Null(I18nCommand.CountedTally("Archive.Log.ScanDone", "Folders: {0}, indexed: {1}, adopted: {2}, removed: {3}"));
// A single participle after a placeholder is as often a name or a size as a count.
Assert.Null(I18nCommand.CountedTally("Export.Log.Failed", "{0} failed: {1}"));
Assert.Null(I18nCommand.CountedTally("Library.Queued", "{0} queued · {1}"));
Assert.Null(I18nCommand.CountedTally("Import.Plan.SpaceMissing", "{0} missing"));
Assert.Null(I18nCommand.CountedTally("Settings.Storage.Usage", "{0} used · {1} free"));
Assert.Null(I18nCommand.CountedTally("Import.Result.Skipped.other", "{0:N0} copied, {1:N0} skipped"));
}
}