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.

UI: Cabinet refusals use the holder's Hebrew office title (fixes #990) (#995)

Jacob Cohen0c76fce6d7f1
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a481dca27..328c1c398 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,6 +8,8 @@ adds a line under **Unreleased**; CI's `Changelog` job checks this (see `CONTRIB
## [Unreleased]
### Fixed
+- The Cabinet's Hebrew "already holds" refusal uses the holder's office title, including the feminine form for a woman;
+ English is unchanged (#990).
- On a phone held upright (390x844) the top bar's small text keeps the owner's 12 px floor too: the seven captions,
Security's level, the attention line and the plate's turn and date are 25 px in the panel, 12.3 px on screen (they
were 15 px, 7.4 px). The phone's bar is 32 px taller to hold them, a caption wraps between words, and Security's level
diff --git a/unity/Assets/Scripts/UI/CabinetPresenter.cs b/unity/Assets/Scripts/UI/CabinetPresenter.cs
index aaa1e1e85..b29530864 100644
--- a/unity/Assets/Scripts/UI/CabinetPresenter.cs
+++ b/unity/Assets/Scripts/UI/CabinetPresenter.cs
@@ -289,7 +289,7 @@ namespace Statecraft.Game.UI
case "abolished": case "not_established": return text.Format(key, Office(reason.Values[0]), Date(reason.Values[1]));
case "died": return text.Format(key, Person(reason.Values[0]), Date(reason.Values[1]));
case "is_president": case "is_chief_of_staff": case "not_career_officer": return text.Format(key, Person(reason.Values[0]));
- case "already_holds": return text.Format(key, Person(reason.Values[0]), Office(reason.Values[1]));
+ case "already_holds": return text.Format(key, Person(reason.Values[0]), ContentNames.Of(text, c.Offices.First(o => o.Id == reason.Values[1]), c.People.First(p => p.Id == reason.Values[0])));
case "party_not_coalition": return text.Format(key, Person(reason.Values[0]), Party(reason.Values[1]));
default: return text[key];
}
diff --git a/unity/Assets/Tests/EditMode/CabinetScreenTests.cs b/unity/Assets/Tests/EditMode/CabinetScreenTests.cs
index dfbc18de9..152a10aa6 100644
--- a/unity/Assets/Tests/EditMode/CabinetScreenTests.cs
+++ b/unity/Assets/Tests/EditMode/CabinetScreenTests.cs
@@ -135,6 +135,22 @@ public class CabinetScreenTests
Assert.AreEqual("אהרון ציזלינג ממפלגת מפ״ם, שאינה בקואליציה", ui.Q<Label>("cand-zisling-reason").text);
}
+ [TestCase(true, "labour_minister", "golda_meir", "גולדה מאיר כבר בתפקיד שרת העבודה")]
+ [TestCase(false, "labour_minister", "golda_meir", "Golda Meir already holds the office of Minister of Labour")]
+ [TestCase(true, "finance_minister", "kaplan", "אליעזר קפלן כבר בתפקיד שר האוצר")]
+ [TestCase(false, "finance_minister", "kaplan", "Eliezer Kaplan already holds the office of Minister of Finance")]
+ public void AlreadyHeldOfficeUsesTheHoldersTitle(bool hebrew, string office, string person, string expected)
+ {
+ using var ui = Shown();
+ var text = hebrew ? He : Text;
+ var bridge = new SimBridge(In1950().Session, text);
+ using var cabinet = new CabinetPresenter(ui.Root, bridge, text, null);
+ cabinet.Select(office);
+ Assert.AreEqual("already_holds", Cabinet.CheckReason(C, bridge.State, office, person)!.Kind);
+ Assert.IsFalse(ui.Q<Button>("appoint-" + person).enabledSelf);
+ Assert.AreEqual(expected, ui.Q<Label>("cand-" + person + "-reason").text);
+ }
+
[Test]
public void AppointingTakesEffectAtEndTurn()
{