A Civilization-style strategy game about governing Israel from 15 May 1948. Real ministers, real map, every fact sourced. Unity + deterministic C# sim.
Hebrew: the Defence header gives a woman minister the feminine title (Refs #2533) (#3144)
Eyal Golanc494a289dd8b
diff --git a/changelog.d/2533-defence-title-he.md b/changelog.d/2533-defence-title-he.mdnew file mode 100644index 000000000..2d9304569--- /dev/null+++ b/changelog.d/2533-defence-title-he.md@@ -0,0 +1,3 @@+### Fixed+- Hebrew: the Defence screen's header gives a woman Minister of Defense the feminine title ("שרת הביטחון", the office's+ title_he_f in content/offices.yaml), as her card below it does (Refs #2533). The English header is unchanged.diff --git a/unity/Assets/Scripts/UI/DefencePresenter.cs b/unity/Assets/Scripts/UI/DefencePresenter.csindex 57b1327c6..66f2fd23c 100644--- a/unity/Assets/Scripts/UI/DefencePresenter.cs+++ b/unity/Assets/Scripts/UI/DefencePresenter.cs@@ -158,8 +158,11 @@ namespace Statecraft.Game.UIrow.EnableInClassList("rung-target", rung == target && target != s.Rung); // the level an order will move to}string NameOrVacant(Person? p) => p == null ? text["cabinet.vacant"] : ContentNames.Of(text, p);+ // The minister's title is the office's, for its holder (#2533): a woman is "שרת הביטחון" (title_he_f), as on her card.+ var minister = Cabinet.Holder(c, s, "defense_minister");screen.Q<Label>("defence-command").text = text.Format("defence.command",- NameOrVacant(Cabinet.Holder(c, s, "defense_minister")), NameOrVacant(Cabinet.Holder(c, s, "chief_of_staff")));+ ContentNames.Of(text, c.Offices.First(o => o.Id == "defense_minister"), minister, s.Date), NameOrVacant(minister),+ NameOrVacant(Cabinet.Holder(c, s, "chief_of_staff")));// One card per person: a leader who holds several of these offices (Ben-Gurion, Prime Minister and Minister of// Defense) has one card listing them all; a vacancy keeps its own card.var lineup = Cabinet.Lineup(c, s);diff --git a/unity/Assets/Tests/EditMode/DefenceScreenTests.cs b/unity/Assets/Tests/EditMode/DefenceScreenTests.csindex 133fe3faf..9ba4a52a6 100644--- a/unity/Assets/Tests/EditMode/DefenceScreenTests.cs+++ b/unity/Assets/Tests/EditMode/DefenceScreenTests.cs@@ -396,4 +396,32 @@ public class DefenceScreenTestsAssert.AreEqual(Text.Format("defence.mob_cost", PlayerText.Money(c, "treasury", EconomySystem.MobilizationCost(c, bridge.State.Date, bridge.State.Mobilization))),ui.Q<Label>("mob-cost").text);}++ /// <summary>#2533: a woman Minister of Defense is "שרת הביטחון" in the Hebrew header (offices.yaml's title_he_f), as on her+ /// card below it; the English header is unchanged. No shipped date has a woman in the office, so Golda Meir+ /// (title_he_form feminine) holds it here from the start.</summary>+ [Test]+ public void AWomanMinisterOfDefenseHasTheFeminineTitleInTheHebrewHeader()+ {+ var c = ContentLoader.Load(Paths.Content);+ foreach (var p in c.People) p.Offices.RemoveAll(t => t.Office == "defense_minister");+ var golda = c.People.Single(p => p.Id == "golda_meir");+ Assert.AreEqual(TitleHeForms.Feminine, golda.TitleHeForm, "precondition: the fixture's minister is a woman");+ golda.Offices.Add(new OfficeTerm { Office = "defense_minister", From = new System.DateTime(1948, 5, 14) });+ var he = UiText.Parse(AssetDatabase.LoadAssetAtPath<TextAsset>(UiPaths.StringsHebrew).text, "strings.he.yaml");+ foreach (var (text, expected) in new[]+ {+ (he, "שרת הביטחון {0} · הרמטכ״ל {1}"),+ (Text, "Minister of Defense {0} · Chief of Staff {1}"),+ })+ {+ using var ui = new UiTestKit();+ ui.Q<VisualElement>("screen-defence").style.display = DisplayStyle.Flex;+ var bridge = new SimBridge(GameSession.New(c, GoldenRun.Seed, Mode.Historical), text);+ new DefencePresenter(ui.Root, bridge, text);+ Assert.AreSame(golda, Cabinet.Holder(c, bridge.State, "defense_minister"), "precondition: she holds the office");+ var chief = Cabinet.Holder(c, bridge.State, "chief_of_staff")!;+ Assert.AreEqual(string.Format(System.Globalization.CultureInfo.InvariantCulture, expected, ContentNames.Of(text, golda), ContentNames.Of(text, chief)), ui.Q<Label>("defence-command").text);+ }+ }}diff --git a/unity/Assets/UI/strings.en.yaml b/unity/Assets/UI/strings.en.yamlindex 259897348..1d7d876e8 100644--- a/unity/Assets/UI/strings.en.yaml+++ b/unity/Assets/UI/strings.en.yaml@@ -382,7 +382,7 @@ defence.rung5: "5 Full war"defence.turn_quarter: "turns of a quarter"defence.turn_month: "turns of a month"defence.turn_week: "turns of a week"-defence.command: "Minister of Defense {0} · Chief of Staff {1}"+defence.command: "{0} {1} · Chief of Staff {2}" # {0} is the office's title (content/offices.yaml, #2533)defence.ceasefire: "If full war goes on, the UN imposes a ceasefire in {0}" # {0} is "1 week"/"N weeks" (DefencePresenter.Weeks, #2530)defence.order: "Ordered: level {0} to {1}"defence.mob: "{0} of reserves called up (level {1} needs at least {2})"diff --git a/unity/Assets/UI/strings.he.yaml b/unity/Assets/UI/strings.he.yamlindex a907ddfa4..3121312ac 100644--- a/unity/Assets/UI/strings.he.yaml+++ b/unity/Assets/UI/strings.he.yaml@@ -436,7 +436,8 @@ defence.rung5: "5 מלחמה כוללת"defence.turn_quarter: "תורות של רבעון"defence.turn_month: "תורות של חודש"defence.turn_week: "תורות של שבוע"-defence.command: "שר הביטחון {0} · הרמטכ״ל {1}"+# {0} is the office's title for its holder (content/offices.yaml title_he / title_he_f, #2533)+defence.command: "{0} {1} · הרמטכ״ל {2}"defence.ceasefire: "אם המלחמה תימשך במלוא עוצמתה, האו״ם יכפה הפסקת אש בעוד {0} שבועות"defence.order: "ניתנה פקודה: מדרגה {0} לדרגה {1}"defence.mob: "{0} מכוחות המילואים גויסו (דרגה {1} דורשת לפחות {2})"