Skip to content

A Civilization-style strategy game about governing Israel from 15 May 1948. Real ministers, real map, every fact sourced. Unity + deterministic C# sim.

Format armistice map dates in the UI language (#1167)

Aviel Cohen2b07e7eecdb7
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 307368680..66a7af814 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,6 +8,9 @@ checks this (see `CONTRIBUTING.md`).
## [Unreleased]
+### Fixed
+- The map info panel formats armistice zone and line dates in the selected UI language, reusing the existing date strings and isolating Hebrew dates inside English fallback rows; English output and agreement data are unchanged (refs #558).
+
## [0.1.4] - 2026-10-22
### Added
diff --git a/unity/Assets/Scripts/UI/InfoPanelPresenter.cs b/unity/Assets/Scripts/UI/InfoPanelPresenter.cs
index 300ad88bb..f739c81d3 100644
--- a/unity/Assets/Scripts/UI/InfoPanelPresenter.cs
+++ b/unity/Assets/Scripts/UI/InfoPanelPresenter.cs
@@ -233,6 +233,13 @@ namespace Statecraft.Game.UI
/// its 1948 sub-district; then each armistice line in force through it.</summary>
public static string RegionText(MapRegions regions, UiText text, int q, int r, System.DateTime date)
{
+ // Isolate a Hebrew date from the surrounding English fallback names: otherwise the row's
+ // LTR paragraph can place its day before its year/month (the mixed-language #558 browser regression).
+ string DateText(System.DateTime signed)
+ {
+ var value = Control1948.DateText(signed, k => text[k]);
+ return UiDirection.HasRightToLeft(value) ? "\u2067" + value + "\u2069" : value;
+ }
var parts = new List<string>();
var zone = regions.ZoneAt(q, r, date);
var control = ControlText(regions, text, q, r, date);
@@ -240,10 +247,10 @@ namespace Statecraft.Game.UI
if (control != "" && !(zone != null && regions.Control?.At(q, r, date).side == Control1948.Side.Dmz)) parts.Add(control);
// the sub-district only while the map draws the sub-district bands (before the first sourced line, or with no side data)
var sub = regions.Subdistricts.ShowsOn(date) && regions.ControlPeriod(date) == null ? regions.Subdistricts.SubdistrictAt(q, r) : null;
- if (zone != null) parts.Add(text.Format("info.armistice_zone", zone.Name, zone.Agreement, MapRegions.DateText(zone.Signed)));
+ if (zone != null) parts.Add(text.Format("info.armistice_zone", zone.Name, zone.Agreement, DateText(zone.Signed)));
else if (sub != null) parts.Add(text.Format("info.region", sub.Name, sub.District));
foreach (var l in regions.LinesAt(q, r, date))
- parts.Add(text.Format(l.LowAccuracy ? "info.armistice_line_low" : "info.armistice_line", l.Name, l.Agreement, MapRegions.DateText(l.Signed)));
+ parts.Add(text.Format(l.LowAccuracy ? "info.armistice_line_low" : "info.armistice_line", l.Name, l.Agreement, DateText(l.Signed)));
return string.Join("\n", parts);
}
diff --git a/unity/Assets/Tests/EditMode/ArmisticeTests.cs b/unity/Assets/Tests/EditMode/ArmisticeTests.cs
index bcec79ddb..8c576426d 100644
--- a/unity/Assets/Tests/EditMode/ArmisticeTests.cs
+++ b/unity/Assets/Tests/EditMode/ArmisticeTests.cs
@@ -193,31 +193,32 @@ public class ArmisticeTests
"Egypt (וגם 1950 modus vivendi), Lebanon, Jordan (דיוק נמוך), Syria"), en.Replace(Lrm, ""));
}
- [Test]
- public void TheInfoPanelNamesTheZoneOrLineAndTheAgreement()
+ [TestCase(false)]
+ [TestCase(true)]
+ public void TheInfoPanelNamesTheZoneOrLineAndTheAgreement(bool hebrew)
{
- var m = Regions(); var t = Text; var a = m.Armistice!;
+ var m = Regions(); var t = hebrew ? HeText : Text; var a = m.Armistice!;
var auja = a.Zones.Single(z => z.Key == "egypt_el_auja_dmz");
var (q, r) = a.HexesOf(auja).First();
StringAssert.Contains("Beersheba Sub-District", InfoPanelPresenter.RegionText(m, t, q, r, Start));
- Assert.AreEqual(t.Format("info.armistice_zone", auja.Name, "Egypt-Israel General Armistice Agreement", "24 February 1949"),
+ Assert.AreEqual(t.Format("info.armistice_zone", auja.Name, "Egypt-Israel General Armistice Agreement", hebrew ? "\u206724 בפברואר 1949\u2069" : "24 February 1949"),
InfoPanelPresenter.RegionText(m, t, q, r, Egypt).Split('\n')[0]);
var leb = a.Lines.Single(l => l.Key == "lebanon_adl");
var lh = Enumerable.Range(-40, 120).SelectMany(qq => Enumerable.Range(-5, 120).Select(rr => (qq, rr))).First(h => a.LinesAt(h.qq, h.rr, Lebanon).Contains(leb));
StringAssert.DoesNotContain("Lebanon-Israel", InfoPanelPresenter.RegionText(m, t, lh.qq, lh.rr, Lebanon.AddDays(-1)));
- StringAssert.Contains(t.Format("info.armistice_line", leb.Name, "Lebanon-Israel General Armistice Agreement", "23 March 1949"),
+ StringAssert.Contains(t.Format("info.armistice_line", leb.Name, "Lebanon-Israel General Armistice Agreement", hebrew ? "\u206723 במרץ 1949\u2069" : "23 March 1949"),
InfoPanelPresenter.RegionText(m, t, lh.qq, lh.rr, Lebanon));
// the 1950 line names the modus vivendi and its date, not the 1949 agreement
var mv = a.Lines.Single(l => l.Key == "egypt_mv1950_demarcation");
var mh = Hexes().First(h => a.LinesAt(h.q, h.r, new DateTime(1950, 3, 1)).Contains(mv));
var at1950 = InfoPanelPresenter.RegionText(m, t, mh.q, mh.r, new DateTime(1950, 3, 1));
- StringAssert.Contains(t.Format("info.armistice_line", mv.Name, mv.Agreement, "22 February 1950"), at1950);
+ StringAssert.Contains(t.Format("info.armistice_line", mv.Name, mv.Agreement, hebrew ? "\u206722 בפברואר 1950\u2069" : "22 February 1950"), at1950);
StringAssert.DoesNotContain(mv.Name, InfoPanelPresenter.RegionText(m, t, mh.q, mh.r, new DateTime(1950, 2, 21)));
// Jordan lines say they are low-accuracy; line A in the triangle only from its stage date
var tri = a.Lines.Single(l => l.Key == "jordan_adl_iraqi_a_triangle");
var th = Hexes().First(h => a.LinesAt(h.q, h.r, new DateTime(1949, 6, 1)).Contains(tri));
StringAssert.DoesNotContain(tri.Name, InfoPanelPresenter.RegionText(m, t, th.q, th.r, new DateTime(1949, 5, 7)));
- StringAssert.Contains(t.Format("info.armistice_line_low", tri.Name, tri.Agreement, "3 April 1949"),
+ StringAssert.Contains(t.Format("info.armistice_line_low", tri.Name, tri.Agreement, hebrew ? "\u20673 באפריל 1949\u2069" : "3 April 1949"),
InfoPanelPresenter.RegionText(m, t, th.q, th.r, new DateTime(1949, 5, 8)));
}