fix(i18n): plural forms for every text that counts
Findings, advisor reasons and a few UI texts put a count before a plural noun without plural forms, so English and Italian read "1 frames are black". Each such key is now a plural stem (.one/.other) whose count is its first argument; findings and reasons, which travel as data, resolve through the new Loc.Text, which picks the form from that argument (a fraction takes "other"), so stored deep reports and project reasons keep their keys and arguments. Texts with two or more counts (job log lines, "frames with a capture time: 12 of 300") read as labels, which agree with no number. A single exposure change gets its own finding instead of "1 exposure changes, typically 0 frames apart". The converted and reworded keys leave the 36 other catalogs until they are translated again; the dead plain Shell.JobBar.Ready goes too. `i18n check` now fails on an English text that counts a noun without plural forms. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
242 files changed
+348
-2036
No files matched your search
@@ -75,7 +75,7 @@ public static class Advisor
|
||||
public static string Explain(Recommendation recommendation)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(recommendation);
|
||||
return Loc.L(recommendation.ReasonKey, [.. recommendation.ReasonArgs]);
|
||||
return Loc.Text(recommendation.ReasonKey, [.. recommendation.ReasonArgs]);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -86,6 +86,6 @@ public static class Advisor
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(reasonKey);
|
||||
var args = (reasonArgs ?? []).Select(a => double.TryParse(a, NumberStyles.Float, CultureInfo.InvariantCulture, out var number) ? (object)number : a).ToArray();
|
||||
return Loc.L(reasonKey, args);
|
||||
return Loc.Text(reasonKey, args);
|
||||
}
|
||||
}
|
||||
@@ -94,7 +94,8 @@ public static class AdvisorParameters
|
||||
/// <summary>
|
||||
/// One advisor decision (BRIEF §10.3). <see cref="Value"/> is null when data is missing; the reason then says what is
|
||||
/// missing and nothing is changed. <see cref="ReasonArgs"/> are numbers (already rounded for display) or plain tokens,
|
||||
/// formatted by the caller with its culture: <c>Loc.L(ReasonKey, [.. ReasonArgs])</c>.
|
||||
/// formatted by the caller with its culture: <c>Loc.Text(ReasonKey, [.. ReasonArgs])</c>. A reason that counts something is a
|
||||
/// plural stem whose count is the first argument.
|
||||
/// </summary>
|
||||
/// <param name="Confidence">0..1: how strongly the measurements support the value.</param>
|
||||
public sealed record Recommendation(
|
||||
|
||||
Reference in new issue
Block a user