A Civilization-style strategy game about governing Israel from 15 May 1948. Real ministers, real map, every fact sourced. Unity + deterministic C# sim.
Hebrew: a locality tooltip no longer repeats the pill's own name (Refs #2022) (#2031)
agamrafaeli-instinct9ae1a4fbbb0a
diff --git a/changelog.d/2022.md b/changelog.d/2022.mdnew file mode 100644index 000000000..e8eadc5c4--- /dev/null+++ b/changelog.d/2022.md@@ -0,0 +1,5 @@+### Fixed+- A Hebrew locality tooltip no longer repeats the pill's own name (#2022): where the Hebrew today name is the Hebrew+ 1948 name (Umm el Fahm and Umm al-Fahm are both אום אל-פחם - 48 rows), `Localities.TodayName` returns no today name+ in Hebrew, so the tooltip the pill already gives is not restated. The info panel's Hebrew line is unchanged (it+ already dropped the repeat) and English tooltips keep the today name.diff --git a/unity/Assets/Scripts/Map/Kits/Localities.cs b/unity/Assets/Scripts/Map/Kits/Localities.csindex eeb81139c..3100bba5c 100644--- a/unity/Assets/Scripts/Map/Kits/Localities.cs+++ b/unity/Assets/Scripts/Map/Kits/Localities.cs@@ -44,12 +44,15 @@ namespace Statecraft.Game.Map.Kits/// <summary>The one "living place carries on" rule (owner ruling 2026-10-12), shared by the label tooltip and the info/// panel: the name to show as today's name, in Hebrew when asked and one is recorded; null when no living place carries- /// on (<see cref="Place.Today"/> is null) or when today's name is the 1948 name itself (Nablus is Nablus). It shows- /// only what the file records.</summary>+ /// on (<see cref="Place.Today"/> is null) or when today's name is the 1948 name itself (Nablus is Nablus). In Hebrew it is+ /// also null when the Hebrew today name is the Hebrew 1948 name (#2022: Umm el Fahm and Umm al-Fahm are both+ /// אום אל-פחם - the pill already says it, so a tooltip or "(today: ...)" repeating it reads as a glitch). English is+ /// unchanged. It shows only what the file records.</summary>public static string? TodayName(Place p, bool hebrew){if (p.Today == null || SameName(p.Today, p.Settlement.Name)) return null;- return hebrew && !string.IsNullOrEmpty(p.TodayHe) ? p.TodayHe : p.Today;+ if (hebrew && !string.IsNullOrEmpty(p.TodayHe)) return p.TodayHe == p.NameHe ? null : p.TodayHe;+ return p.Today;}static bool SameName(string a, string b)diff --git a/unity/Assets/Tests/EditMode/LocalityNameTests.cs b/unity/Assets/Tests/EditMode/LocalityNameTests.csindex 1f98d8b35..f85cf9f65 100644--- a/unity/Assets/Tests/EditMode/LocalityNameTests.cs+++ b/unity/Assets/Tests/EditMode/LocalityNameTests.cs@@ -107,6 +107,26 @@ public class LocalityNameTestsAssert.AreEqual("", InfoPanelPresenter.LocalitiesText(He, new Localities.Place[0]));}+ /// <summary>#2022: in Hebrew the map tooltip drops a today name that is the pill's own Hebrew name - Umm el Fahm's+ /// pill already reads אום אל-פחם, so a "היום: אום אל-פחם" tooltip repeated it (48 rows). The rule lives in+ /// Localities.TodayName, which the tooltip and the info panel share; the panel's Hebrew line is unchanged (it already+ /// dropped the repeat), and English tooltips keep the today name. Red-first: TodayName returned the Hebrew today name+ /// for these rows, and the tooltip showed it.</summary>+ [Test]+ public void TheHebrewTooltipDropsATodayNameThatIsThePillsOwnName()+ {+ var by = map.Localities.ToDictionary(p => p.Settlement.Id);+ var fahm = by["umm_al_fahm"];+ Assert.AreEqual(fahm.NameHe, fahm.TodayHe, "precondition: one Hebrew word for 1948 and today");+ Assert.AreEqual("Umm al-Fahm", Localities.TodayName(fahm, false), "English unchanged");+ Assert.IsNull(Localities.TodayName(fahm, true), "the Hebrew today name is the pill's own name");+ Assert.AreEqual("Today: Umm al-Fahm", MapLabelsPresenter.TipOf(fahm, n => "Today: " + n, "Mixed locality"), "the English tooltip keeps it");+ Assert.IsNull(MapLabelsPresenter.TipOf(fahm, n => "Today: " + n, "Mixed locality", hebrew: true), "no Hebrew tooltip repeats the pill");+ foreach (var p in map.Localities)+ Assert.IsTrue(Localities.TodayName(p, true) == null || Localities.TodayName(p, true) != p.NameHe,+ p.Settlement.Id + ": no Hebrew today name repeats the 1948 name");+ }+/// <summary>#899: under Hebrew each 1948 locality is named by its name_he (Beisan is ביסאן), and by the English name where the/// row has none (since #1344 every row has one, so a copy of Ghazawiya's row without it stands in). Where the Hebrew/// 1948 name and the Hebrew today name are one word (Umm el Fahm and Umm al-Fahm are both אום אל-פחם: 48 rows that would otherwise show a today name), the "today" part would repeat the name, so it is left out. English is unchanged.</summary>