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: the Objectives screen reads each name from objectives.yaml (Fixes #1208) (#1215)

Beri90625d828acf
diff --git a/changelog.d/ui-objectives-name-he-1208.md b/changelog.d/ui-objectives-name-he-1208.md
new file mode 100644
index 000000000..9efa5c14a
--- /dev/null
+++ b/changelog.d/ui-objectives-name-he-1208.md
@@ -0,0 +1,6 @@
+### Fixed
+
+- **The Objectives screen reads each objective's Hebrew name from `content/objectives.yaml` (#1208).** In Hebrew it shows
+ `name_he`, otherwise `name`; the second copy of the names in the two strings files is gone, so a new objective needs no
+ strings key. One wording changes on screen: the first objective now reads "היישוב החדש הראשון" (it was "יישוב חדש ראשון");
+ the Hebrew is still an AI translation that waits for the native read on #564.
diff --git a/unity/Assets/Scripts/UI/ContentNames.cs b/unity/Assets/Scripts/UI/ContentNames.cs
index 42bb8b0d1..073202b60 100644
--- a/unity/Assets/Scripts/UI/ContentNames.cs
+++ b/unity/Assets/Scripts/UI/ContentNames.cs
@@ -14,6 +14,7 @@ namespace Statecraft.Game.UI
public static string Of(UiText text, Person p) => Pick(text, p.Name, p.NameHe);
public static string Of(UiText text, Party p) => Pick(text, p.Name, p.NameHe);
public static string Of(UiText text, Government g) => Pick(text, g.Name, g.NameHe);
+ public static string Of(UiText text, Objective o) => Pick(text, o.Name, o.NameHe);
public static string Of(UiText text, Legislature l) => Pick(text, l.Body, l.BodyHe);
/// <summary>A city project kind's name: its draft name_he, pending a native speaker's review (#564, #1122).</summary>
public static string Of(UiText text, ProjectKind k) => Pick(text, k.Name, k.NameHe);
diff --git a/unity/Assets/Scripts/UI/ObjectivesPresenter.cs b/unity/Assets/Scripts/UI/ObjectivesPresenter.cs
index 36055dcfe..3c9f3d763 100644
--- a/unity/Assets/Scripts/UI/ObjectivesPresenter.cs
+++ b/unity/Assets/Scripts/UI/ObjectivesPresenter.cs
@@ -1,4 +1,5 @@
#nullable enable
+using System.Linq;
using Statecraft.Sim;
using UnityEngine.UIElements;
@@ -32,9 +33,8 @@ namespace Statecraft.Game.UI
{
var row = new VisualElement { name = "objectives-row-" + o.Id };
row.AddToClassList("objectives-row");
- // A new objective (#791) with no strings key yet still shows, under its objectives.yaml name.
- var key = "objectives.name." + o.Id;
- var name = new Label(text.Has(key) ? text[key] : o.Name);
+ // The name is objectives.yaml's own, in the UI's language (#1208), so a new objective (#791) needs no strings key.
+ var name = new Label(ContentNames.Of(text, bridge.Content.Objectives.Single(x => x.Id == o.Id)));
name.AddToClassList("objectives-name");
var status = new Label(o.Completed is System.DateTime done
? text.Format("objectives.done", Date(done), Date(o.Historical))
diff --git a/unity/Assets/Tests/EditMode/ObjectivesScreenTests.cs b/unity/Assets/Tests/EditMode/ObjectivesScreenTests.cs
index 3322cd7a9..1ba202db5 100644
--- a/unity/Assets/Tests/EditMode/ObjectivesScreenTests.cs
+++ b/unity/Assets/Tests/EditMode/ObjectivesScreenTests.cs
@@ -62,10 +62,12 @@ public class ObjectivesScreenTests
for (int i = 0; i < status.Count; i++)
{
var o = status[i];
- // Every objective on main has its name in both strings files (the presenter's objectives.yaml fallback is for #791).
- Assert.IsTrue(text.Has("objectives.name." + o.Id), when + ": " + o.Id + " has a name in this language");
+ // The name is objectives.yaml's own (#1208): name_he in Hebrew, name in English; no copy in the strings files.
+ var objective = C.Objectives.Single(x => x.Id == o.Id);
+ Assert.IsNotEmpty(objective.NameHe, o.Id + " has a Hebrew name in objectives.yaml");
+ Assert.IsFalse(text.Has("objectives.name." + o.Id), when + ": " + o.Id + " has no second copy of the name in the strings file");
Assert.AreEqual("objectives-row-" + o.Id, rows[i].name, when + ": the helper's order");
- Assert.AreEqual(text["objectives.name." + o.Id], rows[i].Q<Label>(className: "objectives-name").text, when + ": " + o.Id + " name");
+ Assert.AreEqual(hebrew ? objective.NameHe : objective.Name, rows[i].Q<Label>(className: "objectives-name").text, when + ": " + o.Id + " name");
var line = rows[i].Q<Label>(className: "objectives-status").text;
Assert.AreEqual(o.Completed is System.DateTime done
? text.Format("objectives.done", Date(text, done), Date(text, o.Historical))
diff --git a/unity/Assets/UI/strings.en.yaml b/unity/Assets/UI/strings.en.yaml
index 4eb0dd44a..da68d1d0d 100644
--- a/unity/Assets/UI/strings.en.yaml
+++ b/unity/Assets/UI/strings.en.yaml
@@ -65,12 +65,10 @@ how_to_play.end_turn: "End turn carries out your orders and moves to the next mo
how_to_play.why: "After a turn, open Why? to see each change and its cause."
# The Objectives screen (#1189): every objective in objectives.yaml, done or not, the player's date beside the historical
# one, and no score (owner, 20 October 2026). The objective card's wording (#380). {0} the player's date,
-# {1} the historical date (objectives.open: {0}). A name falls back to objectives.yaml's when it has no key here.
+# {1} the historical date (objectives.open: {0}). The names are objectives.yaml's (#1208).
objectives.title: "Objectives"
objectives.done: "Completed on {0}; historically {1}"
objectives.open: "Not completed yet; historically {0}"
-objectives.name.first_new_yishuv: "First new yishuv"
-objectives.name.absorb_immigrants: "Absorb the immigrants"
# How to play's button that opens the first-turn guide again (#42).
how_to_play.guide: "Show the first-turn guide"
# The first-turn guide (#42; Q-ONB-1, owner, 17 October 2026, #784): five steps, each pointing at its part of the HUD
diff --git a/unity/Assets/UI/strings.he.yaml b/unity/Assets/UI/strings.he.yaml
index 08f5752ef..ce851b1e6 100644
--- a/unity/Assets/UI/strings.he.yaml
+++ b/unity/Assets/UI/strings.he.yaml
@@ -60,8 +60,6 @@ how_to_play.why: "אחרי תור, פתחו את המסך למה? כדי לרא
objectives.title: "יעדים"
objectives.done: "הושלם ב־{0}; בהיסטוריה ב־{1}"
objectives.open: "טרם הושלם; בהיסטוריה ב־{0}"
-objectives.name.first_new_yishuv: "יישוב חדש ראשון"
-objectives.name.absorb_immigrants: "קליטת העולים"
# How to play's button that opens the first-turn guide again (#42). For the native reviewer (#564).
how_to_play.guide: "הצגת המדריך לתור הראשון"
# The first-turn guide (#42): agent-drafted Hebrew, the How to play screen's terms (#1041) and the city panel's (city.*).