From 5b1577ea37f4f3a334829aa02155c791dd34ce1b Mon Sep 17 00:00:00 2001 From: Mason Schmidgall <13247733+spicydll@users.noreply.github.com> Date: Sat, 31 May 2025 16:55:45 -0500 Subject: [PATCH] Update HeadsUpMessage.ts to support translations (#981) ## Description: This change fixes the spawn message to use `translateText()`. I'll ensure I don't miss this again. ![image](https://github.com/user-attachments/assets/76868b1c-701d-4035-bc55-34f3635ecf06) ## 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 - [x] I understand that submitting code with bugs that could have been caught through manual testing blocks releases and new features for all contributors ## Please put your Discord username so you can be contacted if a bug or regression is found: .spicydll --- resources/lang/debug.json | 3 +++ resources/lang/en.json | 3 +++ src/client/graphics/layers/HeadsUpMessage.ts | 3 ++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/resources/lang/debug.json b/resources/lang/debug.json index 0e6eaf3ca..5b7c27515 100644 --- a/resources/lang/debug.json +++ b/resources/lang/debug.json @@ -164,5 +164,8 @@ "Balanced": "difficulty.Balanced", "Intense": "difficulty.Intense", "Impossible": "difficulty.Impossible" + }, + "heads_up_message": { + "choose_spawn": "heads_up_message.choose_spawn" } } diff --git a/resources/lang/en.json b/resources/lang/en.json index e75ecdb6e..d65dd52c0 100644 --- a/resources/lang/en.json +++ b/resources/lang/en.json @@ -428,5 +428,8 @@ "copied": "Copied!", "failed_copy": "Failed to copy", "desync_notice": "You are desynced from other players. What you see might differ from other players." + }, + "heads_up_message": { + "choose_spawn": "Choose a starting location" } } diff --git a/src/client/graphics/layers/HeadsUpMessage.ts b/src/client/graphics/layers/HeadsUpMessage.ts index 8dd68d59a..5c1e206d9 100644 --- a/src/client/graphics/layers/HeadsUpMessage.ts +++ b/src/client/graphics/layers/HeadsUpMessage.ts @@ -1,6 +1,7 @@ import { LitElement, html } from "lit"; import { customElement, state } from "lit/decorators.js"; import { GameView } from "../../../core/game/GameView"; +import { translateText } from "../../Utils"; import { Layer } from "./Layer"; @customElement("heads-up-message") @@ -39,7 +40,7 @@ export class HeadsUpMessage extends LitElement implements Layer { backdrop-blur-md text-white text-md lg:text-xl p-1 lg:p-2" @contextmenu=${(e) => e.preventDefault()} > - Choose a starting location + ${translateText("heads_up_message.choose_spawn")} `; }