A Civilization-style strategy game about governing Israel from 15 May 1948. Real ministers, real map, every fact sourced. Unity + deterministic C# sim.
End screen: the objectives' titles follow the UI's language (Refs #2041) (#2047)
agamrafaeli-instinct67b03ef20ef3
diff --git a/changelog.d/2041.md b/changelog.d/2041.mdnew file mode 100644index 000000000..602b75b66--- /dev/null+++ b/changelog.d/2041.md@@ -0,0 +1,4 @@+### Fixed+- The end screen titles each objective the way its decision card does, in the UI's language (#2041): in Hebrew the+ card's `title_he` shows where there is no variant title (a variant has no Hebrew), the English otherwise, instead of+ the English title inside the Hebrew line. English is unchanged.diff --git a/unity/Assets/Scripts/UI/EndScreenPresenter.cs b/unity/Assets/Scripts/UI/EndScreenPresenter.csindex 26f3dce2d..fe7900bd6 100644--- a/unity/Assets/Scripts/UI/EndScreenPresenter.cs+++ b/unity/Assets/Scripts/UI/EndScreenPresenter.cs@@ -90,7 +90,11 @@ namespace Statecraft.Game.UIif (r.ReferenceScore > 0) lines.Add(("score-reference", t.Format("end.reference_score", r.ReferenceScore)));foreach (var o in r.Objectives){- var title = EventSystem.Title(c, s, c.Events.First(e => e.Id == o.Card)); // as the objective's card shows it+ var card = c.Events.First(e => e.Id == o.Card);+ var variant = Timeline.Variant(c, s, card);+ // As the objective's card shows it (EventCardPresenter), in the UI's language (#2041): the Hebrew title_he+ // where there is no variant title (a variant has no Hebrew), the English otherwise.+ var title = ContentNames.Fill(t, c, s, s.Date, EventSystem.Title(c, s, card), variant == null || variant.Title == "" ? card.TitleHe : "");lines.Add(("objective-" + o.Id, o.Completed is DateTime done? t.Format("end.objective_done", title, Date(done), Date(o.Historical)): t.Format("end.objective_open", title, Date(o.Historical))));diff --git a/unity/Assets/Tests/EditMode/EndScreenTests.cs b/unity/Assets/Tests/EditMode/EndScreenTests.csindex 60f64be89..0c7101eea 100644--- a/unity/Assets/Tests/EditMode/EndScreenTests.cs+++ b/unity/Assets/Tests/EditMode/EndScreenTests.cs@@ -264,6 +264,28 @@ public class EndScreenTestsk.Dispose_End_Reload(En); // the kit disposes it once more at the end}+ /// <summary>#2041: in Hebrew an objective's line titles it as its decision card does - the Hebrew title_he where+ /// there is no variant title, the English otherwise (EventCardPresenter's pick). English is unchanged, pinned by+ /// ShowsEveryPartOfTheReportAndNothingElse. Red-first: Lines used the English EventSystem.Title in every language.+ /// </summary>+ [Test]+ public void HebrewTitlesTheObjectivesAsTheirCardsDo()+ {+ using var k = new Kit(He, Ended);+ var s = k.Bridge.State;+ var lines = EndScreenPresenter.Lines(C, s, He);+ foreach (var o in C.Objectives)+ {+ var card = C.Events.First(e => e.Id == o.Card);+ var variant = Timeline.Variant(C, s, card);+ Assert.IsTrue(variant == null || variant.Title == "", o.Id + " precondition: no variant title");+ Assert.AreNotEqual("", card.TitleHe, o.Id + " precondition: the card has a Hebrew title");+ var line = lines.Single(l => l.Name == "objective-" + o.Id).Text;+ StringAssert.Contains(card.TitleHe, line, o.Id + ": the Hebrew line shows the card's Hebrew title");+ StringAssert.DoesNotContain(EventSystem.Title(C, s, card), line, o.Id + ": not the English title");+ }+ }+[Test]public void HebrewShowsTheHebrewWords(){