A Civilization-style strategy game about governing Israel from 15 May 1948. Real ministers, real map, every fact sourced. Unity + deterministic C# sim.
UI: Hebrew map name pills show the row's name_he (refs #880) (#897)
Beribacc060f81b2
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 40e42c173..d73b4ab01 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -13,6 +13,9 @@ adds a line under **Unreleased**; CI's `Changelog` job checks this (see `CONTRIBtarget follows with its pool (#781).### Fixed+- In the Hebrew UI the map's name pills show each row's `name_he`: the game settlements ("נהלל", "תל אביב") and+ the 1948 localities that have one. The thirteen localities with no `name_he` keep their English name, and the+ English UI is unchanged. The tier badge stays on the left of the pill until the owner rules on mirroring it (#880).- The content loader now checks `name_he_review` on people rows the way it does for parties, governments,legislatures, offices and settlements: the flag is `agent-checked` or left out, and only beside a `name_he`(CONTENT_POLICY section 2, rule 6; #862). No people row carries the flag yet, so no row changes.diff --git a/unity/Assets/Scripts/Map/Kits/Localities.cs b/unity/Assets/Scripts/Map/Kits/Localities.csindex f1cb4a01f..eeb81139c 100644--- a/unity/Assets/Scripts/Map/Kits/Localities.cs+++ b/unity/Assets/Scripts/Map/Kits/Localities.cs@@ -29,7 +29,7 @@ namespace Statecraft.Game.Map.Kits/// <summary>The kit's and label's settlement record: id, the 1948 name, the repo type, coordinates.</summary>public Settlement Settlement = null!;/// <summary>The 1948 Hebrew name (#558: the form matching the English name, sourced in the YAML); null where the file- /// gives none (thirteen villages), when the map keeps the English. Data only until the UI wiring reads it.</summary>+ /// gives none (thirteen villages), when the map keeps the English. The Hebrew UI's pill shows it (#880).</summary>public string? NameHe;/// <summary>The living place's name today (and in Hebrew), only where one carries on (owner ruling 2026-10-12);/// null for a place that did not: then no tooltip.</summary>diff --git a/unity/Assets/Scripts/UI/GameRoot.cs b/unity/Assets/Scripts/UI/GameRoot.csindex 91a8d557b..c5e6cbff5 100644--- a/unity/Assets/Scripts/UI/GameRoot.cs+++ b/unity/Assets/Scripts/UI/GameRoot.cs@@ -316,7 +316,8 @@ namespace Statecraft.Game.UI},// Issue #710: the static 1948 tier from cities.yaml's people, not the sim's live count (owner, 15 October 2026).bridge.Content.Cities.Where(c => c.People != null).ToDictionary(c => c.Id, c => c.People!.Value),- (tier, people) => text.Format("map.tier", tier, MapLabelsPresenter.TierCount, people.ToString("N0", CultureInfo.InvariantCulture))));+ (tier, people) => text.Format("map.tier", tier, MapLabelsPresenter.TierCount, people.ToString("N0", CultureInfo.InvariantCulture)),+ hebrew));mini.Clicked += (lon, lat) => { camRig.LookAt = map.Frame.ToWorld(lon, lat, 0); cameraController.Settle(); SyncMinimap(); labels?.Refresh(); }; // the click may come after LateUpdate (review M6)// The minimap's whole-map button: the camera's own farthest zoom, over the middle of the map (no new rule).mini.Overview += () =>diff --git a/unity/Assets/Scripts/UI/MapLabelsPresenter.cs b/unity/Assets/Scripts/UI/MapLabelsPresenter.csindex e358b10d5..edb957232 100644--- a/unity/Assets/Scripts/UI/MapLabelsPresenter.cs+++ b/unity/Assets/Scripts/UI/MapLabelsPresenter.cs@@ -169,7 +169,7 @@ namespace Statecraft.Game.UIpublic MapLabelsPresenter(VisualElement root, MapScene map, Camera camera, Func<float>? zoomDistance = null, Func<Statecraft.Game.Map.Kits.Localities.Place, string?>? tipText = null,Func<IReadOnlyList<Bounds[]>?>? keepClear = null, IReadOnlyDictionary<string, decimal>? population = null,- Func<int, decimal, string>? tierTip = null)+ Func<int, decimal, string>? tierTip = null, bool hebrew = false){var tip = tipText ?? DefaultTip;this.keepClear = keepClear;@@ -185,7 +185,8 @@ namespace Statecraft.Game.UIvar slot = new VisualElement { name = "slot-" + s.Id, pickingMode = PickingMode.Ignore };slot.AddToClassList(SlotClass);var anchorClass = AnchorClass.TryGetValue(s.Id, out var a) ? a : Centre;- var label = new Label(s.Name) { name = "label-" + s.Id, pickingMode = PickingMode.Ignore };+ // #880: the Hebrew UI shows the row's name_he, and the English name where the row has none.+ var label = new Label(hebrew && !string.IsNullOrWhiteSpace(s.NameHe) ? s.NameHe : s.Name) { name = "label-" + s.Id, pickingMode = PickingMode.Ignore };label.AddToClassList(LabelClass);label.AddToClassList("map-label-" + s.Type);label.AddToClassList(anchorClass);@@ -229,7 +230,7 @@ namespace Statecraft.Game.UIvar s = place.Settlement;var slot = new VisualElement { name = "slot-" + s.Id, pickingMode = PickingMode.Ignore };slot.AddToClassList(SlotClass);- var label = new Label(s.Name) { name = "label-" + s.Id, pickingMode = PickingMode.Ignore };+ var label = new Label(hebrew && !string.IsNullOrWhiteSpace(place.NameHe) ? place.NameHe : s.Name) { name = "label-" + s.Id, pickingMode = PickingMode.Ignore };label.AddToClassList(LabelClass); label.AddToClassList(LocalityClass); label.AddToClassList(Centre);slot.Add(label);container.Add(slot);diff --git a/unity/Assets/Tests/EditMode/HebrewUiTests.cs b/unity/Assets/Tests/EditMode/HebrewUiTests.csindex f10dc713b..b354f430a 100644--- a/unity/Assets/Tests/EditMode/HebrewUiTests.cs+++ b/unity/Assets/Tests/EditMode/HebrewUiTests.cs@@ -297,6 +297,34 @@ public class HebrewUiTests}}+ /// <summary>#880: in Hebrew every map name pill shows its row's name_he, and its English name where the row has none (a+ /// 1948 locality such as Na'ana); an English restart puts the English names back.</summary>+ [Test]+ public void InHebrewEachMapPillShowsItsHebrewNameWhereTheRowHasOne()+ {+ EditorSceneManager.OpenScene("Assets/Map.unity", OpenSceneMode.Single);+ var map = Object.FindFirstObjectByType<MapScene>();+ map.Build(Inputs.Map);+ var game = Object.FindFirstObjectByType<GameRoot>();+ game.Store = new SaveStore(saveDir);+ game.Language = UiLanguage.Hebrew;+ game.Begin(Inputs, 0);+ Assert.AreEqual("נהלל", Ui.Q<Label>("label-nahalal").text);+ Assert.AreEqual("תל אביב", Ui.Q<Label>("label-tel_aviv").text);+ Assert.AreEqual("נשר", Ui.Q<Label>("label-nesher").text, "a 1948 locality with a name_he");+ Assert.AreEqual("Na'ana", Ui.Q<Label>("label-naana").text, "no name_he: the English name stays");+ foreach (var s in map.Settlements)+ Assert.AreEqual(string.IsNullOrWhiteSpace(s.NameHe) ? s.Name : s.NameHe, Ui.Q<Label>("label-" + s.Id).text, s.Id);+ foreach (var p in map.Localities)+ Assert.AreEqual(string.IsNullOrWhiteSpace(p.NameHe) ? p.Settlement.Name : p.NameHe, Ui.Q<Label>("label-" + p.Settlement.Id).text, p.Settlement.Id);++ game.Language = UiLanguage.English;+ game.Begin(Inputs, 0);+ Assert.AreEqual("Nahalal", Ui.Q<Label>("label-nahalal").text);+ foreach (var s in map.Settlements) Assert.AreEqual(s.Name, Ui.Q<Label>("label-" + s.Id).text, $"after an English restart: {s.Id}");+ foreach (var p in map.Localities) Assert.AreEqual(p.Settlement.Name, Ui.Q<Label>("label-" + p.Settlement.Id).text, $"after an English restart: {p.Settlement.Id}");+ }+/// <summary>The loading line is in the UI's language from the first frame, before Begin, in the Hebrew face and right to/// left; a boot failure keeps both. English keeps its line, its face and no direction.</summary>[Test]