From a30859d132fa9a9c4901ce4824fc55bb028c2d17 Mon Sep 17 00:00:00 2001 From: FloPinguin <25036848+FloPinguin@users.noreply.github.com> Date: Tue, 17 Mar 2026 23:30:52 +0100 Subject: [PATCH] =?UTF-8?q?Fix=20labels=20in=20public=20lobby=20modifier?= =?UTF-8?q?=20display=20=F0=9F=8F=B7=EF=B8=8F=20(#3456)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description: Fixes two issues in the join lobby modal's modifier display: 1. **Starting Gold**: Label showed "Starting Gold (Millions)" with value "5M", duplicating "millions". Now shows "Starting Gold" as the label, keeping "5M" as the value. 2. **Disable Alliances**: Label showed "Disable Alliances" with value "Enabled", which is confusing. Now shows "Alliances" as the label with "Disabled" as the value. Join Lobby Modal needs a general rework, I will probably make an PR ## Please complete the following: - [X] I have added screenshots for all UI updates - [X] I process any text displayed to the user through translateText() and I've added it to the en.json file - [X] I have added relevant tests to the test directory - [X] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced ## Please put your Discord username so you can be contacted if a bug or regression is found: FloPinguin --- resources/lang/en.json | 5 ++++- src/client/Utils.ts | 5 +++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/resources/lang/en.json b/resources/lang/en.json index f0ad48559..145dd331b 100644 --- a/resources/lang/en.json +++ b/resources/lang/en.json @@ -24,6 +24,7 @@ "copied": "Copied!", "click_to_copy": "Click to copy", "enabled": "Enabled", + "disabled": "Disabled", "map_default": "Map default" }, "main": { @@ -486,8 +487,10 @@ "crowded": "Crowded", "hard_nations": "Hard Nations", "starting_gold": "{amount}M Starting Gold", + "starting_gold_label": "Starting Gold", "gold_multiplier": "x{amount} Gold Multiplier", - "disable_alliances": "Alliances Disabled" + "disable_alliances": "Alliances Disabled", + "disable_alliances_label": "Alliances" }, "select_lang": { "title": "Select Language" diff --git a/src/client/Utils.ts b/src/client/Utils.ts index a775a6ae6..e3f61d00d 100644 --- a/src/client/Utils.ts +++ b/src/client/Utils.ts @@ -159,7 +159,7 @@ export function getActiveModifiers( (modifiers.startingGold / 1_000_000).toPrecision(12), ); result.push({ - labelKey: "host_modal.starting_gold", + labelKey: "public_game_modifier.starting_gold_label", badgeKey: "public_game_modifier.starting_gold", badgeParams: { amount: millions, @@ -181,8 +181,9 @@ export function getActiveModifiers( } if (modifiers.isAlliancesDisabled) { result.push({ - labelKey: "host_modal.disable_alliances", + labelKey: "public_game_modifier.disable_alliances_label", badgeKey: "public_game_modifier.disable_alliances", + formattedValue: translateText("common.disabled"), }); } return result;