A Civilization-style strategy game about governing Israel from 15 May 1948. Real ministers, real map, every fact sourced. Unity + deterministic C# sim.
Show sourced Hebrew names on unit cards (#1083)
Aviel Cohen79884e272716
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 5729d15ed..3cf695948 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -7,6 +7,9 @@ adds a line under **Unreleased**; CI's `Changelog` job checks this (see `CONTRIB## [Unreleased]+### Added+- Unit cards show the sourced Hebrew unit name in the Hebrew UI, with an English fallback. INS Haganah gains its+ sourced Hebrew name, still flagged for a native speaker's review (#902).### Fixed- The Cabinet, Budget, Defence, Why, How to play and Settings screens each gain an X in the header that closesthem (the same close as Escape): a phone has no Escape key, and re-tapping the lit rail button was the only waydiff --git a/content/map/units_1948.yaml b/content/map/units_1948.yamlindex 821760a38..6695a3ad2 100644--- a/content/map/units_1948.yaml+++ b/content/map/units_1948.yaml@@ -593,6 +593,10 @@ units:# --- Navy: the first ships (four ex-Aliyah Bet ships impounded in Haifa harbour; two are named and sourced here) ----- id: ins_haganahname: INS Haganah (K-20)+ name_he: "אח״י הגנה"+ name_he_review: agent-checked+ # The Palmach service record names the ship; Palyam identifies it as K-20. These sources check the name only.+ name_he_sources: [{url: 'https://palmach.org.il/veterans/veteranpage/?itemId=76294', checked: '2026-10-19'}, {url: 'https://www.palyam.org/Hahapala/Teur_haflagot/hf_Hagana.php', checked: '2026-10-19'}]number: Corvette, commissioned 1948service: navyside: israeldiff --git a/unity/Assets/Scripts/UI/UnitCard.cs b/unity/Assets/Scripts/UI/UnitCard.csindex 37d75d903..fc13aad14 100644--- a/unity/Assets/Scripts/UI/UnitCard.cs+++ b/unity/Assets/Scripts/UI/UnitCard.cs@@ -33,7 +33,7 @@ namespace Statecraft.Game.UIvar hosts = u.AllSources().Select(s => new Uri(s.Url).Host).Distinct(StringComparer.Ordinal).OrderBy(h => h, StringComparer.Ordinal);return new UnitCard{- Title = u.Name,+ Title = text["ui.lang"] == UiLanguage.Hebrew && !string.IsNullOrEmpty(u.NameHe) ? u.NameHe : u.Name,Subtitle = text.Format("unit.subtitle", u.Number, text["unit.service." + u.Service]),Body = string.Join("\n", lines),// Israel's call-up and security level set only Israel's tokens; an Arab force's token reflects neither (#665).diff --git a/unity/Assets/Tests/EditMode/UnitsInPlayTests.cs b/unity/Assets/Tests/EditMode/UnitsInPlayTests.csindex 070f9f4a3..8e302ed89 100644--- a/unity/Assets/Tests/EditMode/UnitsInPlayTests.cs+++ b/unity/Assets/Tests/EditMode/UnitsInPlayTests.cs@@ -123,16 +123,14 @@ public class UnitsInPlayTestsAssert.AreEqual(LastArmistice, UnitData.FrontArmistice["syria"]);}- /// <summary>#902: 20 Hebrew names, each from a cited IDF, Palmach, Haganah Heritage or other Israeli page. INS Haganah's- /// name stays absent until a reviewer settles its spelling; every agent-checked value carries its own dated source- /// pending the native-speaker review in #564.</summary>+ /// <summary>#902: every Hebrew unit name has a dated source and stays agent-checked pending the native-speaker+ /// review in #564.</summary>[Test]public void HebrewUnitNamesAreSourcedAndAgentChecked(){var units = Units;- CollectionAssert.AreEquivalent(new[] { "ins_haganah" },- units.Where(u => string.IsNullOrEmpty(u.NameHe)).Select(u => u.Id));- foreach (var u in units.Where(u => !string.IsNullOrEmpty(u.NameHe)))+ CollectionAssert.IsEmpty(units.Where(u => string.IsNullOrEmpty(u.NameHe)).Select(u => u.Id));+ foreach (var u in units){StringAssert.IsMatch("[א-ת]", u.NameHe, u.Id);Assert.AreEqual("agent-checked", u.NameHeReview, u.Id);@@ -813,6 +811,33 @@ public class UnitsInPlayTestsCollectionAssert.DoesNotContain(VisualToggles.Names, UnitLayer.ToggleName, "the map's teardown removes the switch");}+ [Test]+ public void TheHebrewUnitCardShowsTheSourcedNameAndEnglishKeepsItsName()+ {+ var he = UiText.Parse(AssetDatabase.LoadAssetAtPath<TextAsset>(UiPaths.StringsHebrew).text, "strings.he.yaml");+ var state = StateAt(C.Rules.Start, 5, 0.8);+ foreach (var u in Units)+ {+ // Hidden rows can have no sourced anchor; the card formatter still reads their names.+ var anchor = u.Anchors.FirstOrDefault() ?? new UnitAnchor { Place = "test position" };+ var placed = new PlacedToken(new UnitToken(u, anchor, 0, "", false), default);+ Assert.AreEqual(u.NameHe, UnitCard.For(placed, state, he).Title, u.Id + ": Hebrew title");+ Assert.AreEqual(u.Name, UnitCard.For(placed, state, Text).Title, u.Id + ": English title");+ StringAssert.Contains(u.Sector, UnitCard.For(placed, state, he).Body, u.Id + ": sourced biography retained");+ }+ }++ [Test]+ public void AUnitWithNoHebrewNameKeepsItsEnglishNameInTheHebrewCard()+ {+ var he = UiText.Parse(AssetDatabase.LoadAssetAtPath<TextAsset>(UiPaths.StringsHebrew).text, "strings.he.yaml");+ var u = Units.First(x => x.Id == "golani");+ u.NameHe = "";+ var placed = new PlacedToken(new UnitToken(u, u.Anchors[0], 0, "", false), default);+ var state = StateAt(C.Rules.Start, 5, 0.8);+ Assert.AreEqual(u.Name, UnitCard.For(placed, state, he).Title);+ }+/// <summary>Review I1: "since" only from a sourced start; never the game's first day.</summary>[Test]public void TheCardGivesASinceOnlyFromASourcedStart()