fix(i18n): keep the analysis job log lines under Advisor.Log

Moving them to Jobs.Analysis.* deleted keys that the integration branch
translates into every culture. The advisor resource test now covers the
Advisor.Log.* job lines, as on the integration branch.

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-02 22:50:25 +00:00
1 parent 5610f386ff
commit 91bf442c26
7 files changed
+24 -21

No files matched your search

@@ -19,6 +19,7 @@ public sealed partial class AdvisorLocalizationTests(TestContext context)
{
private static readonly CultureInfo English = CultureInfo.GetCultureInfo("en");
private static readonly CultureInfo Italian = CultureInfo.GetCultureInfo("it");
private const string LogPrefix = "Advisor.Log.";
[Test]
public void EveryAdvisorKeyHasEnglishAndItalianTextWithTheSamePlaceholders()
@@ -26,7 +27,9 @@ public sealed partial class AdvisorLocalizationTests(TestContext context)
var manager = new ResourceManager("Titano.Core.i18n.Advisor", typeof(Loc).Assembly);
var english = Entries(manager.GetResourceSet(CultureInfo.InvariantCulture, createIfNotExists: true, tryParents: false)!);
var italian = Entries(manager.GetResourceSet(Italian, createIfNotExists: true, tryParents: false)!);
var keys = Keys(typeof(AdvisorKeys)).Concat(Keys(typeof(FindingKeys))).Concat(Keys(typeof(DeepFindingKeys))).ToList();
// Job log lines (Advisor.Log.*) are written by the analysis job handlers in Titano.Data, not by the advisor itself.
var keys = Keys(typeof(AdvisorKeys)).Concat(Keys(typeof(FindingKeys))).Concat(Keys(typeof(DeepFindingKeys)))
.Concat(english.Keys.Where(k => k.StartsWith(LogPrefix, StringComparison.Ordinal))).ToList();
Assert.Greater(keys.Count, 90);
foreach (var key in keys)
{
@@ -47,7 +47,7 @@ public sealed class AnalysisJobTests(TestContext context)
Assert.True(row.Status.HasFlag(SequenceStatus.AnalyzedLight), "index status");
Assert.False(row.Status.HasFlag(SequenceStatus.AnalyzedDeep), "no deep status without a report");
Assert.True(ManifestStore.ReadSequence(folder.ManifestPath).Status.HasFlag(SequenceStatus.AnalyzedLight), "sidecar status");
Assert.Contains(Loc.L("Jobs.Analysis.AutoUpdated", sequence.DisplayTitle), done.LogTail);
Assert.Contains(Loc.L("Advisor.Log.AutoUpdated", sequence.DisplayTitle), done.LogTail);
// Idempotent: a second pass changes nothing.
var version = row.SettingsVersion;
@@ -103,7 +103,7 @@ public sealed class AnalysisJobTests(TestContext context)
Assert.NotNull((await fx.Db.Frames.ListBySequenceAsync(sequence.Id, cancellationToken: fx.Ct))[5].MeanLogLuminance);
var project = ProjectSettings.FromJson(await File.ReadAllTextAsync(folder.ProjectPath, fx.Ct));
Assert.True(project.Exposure.Deflicker.HasAdvice, "deflicker advised from the pixels");
Assert.Contains(Loc.L("Jobs.Analysis.Presets", string.Empty), done.LogTail);
Assert.Contains(Loc.L("Advisor.Log.Presets", string.Empty), done.LogTail);
}
[Test]
@@ -131,7 +131,7 @@ public sealed class AnalysisJobTests(TestContext context)
Assert.SequenceEqual([true, true, true], await AnalysedAsync(fx, a, b, c));
Assert.Equal((3L, 3L), (done.ProgressDone, done.ProgressTotal));
// The retry analysed B alone.
var lightOfA = Loc.L("Jobs.Analysis.LightDone", a.DisplayTitle, 10, 0).Split(',')[0];
var lightOfA = Loc.L("Advisor.Log.LightDone", a.DisplayTitle, 10, 0).Split(',')[0];
Assert.Equal(1, done.LogTail!.Split('\n').Count(line => line.Contains(lightOfA, StringComparison.Ordinal)));
}