From 121ac0eede820e77b4ffa993cbb6a118a4ff5926 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moki=20=F0=9F=92=A4?= <38482240+mokizzz@users.noreply.github.com> Date: Thu, 28 Aug 2025 07:29:14 +0900 Subject: [PATCH] Fix: display translated messages when deleting units (#1943) ## Description: Close https://github.com/openfrontio/OpenFrontIO/issues/1844 Fix `src/client/graphics/layers/EventsDisplay.ts` translation logic that prevented messages without parameters from being translated. Now it shows the message correctly: image ## 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: yumika8269 --- src/client/graphics/layers/EventsDisplay.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/client/graphics/layers/EventsDisplay.ts b/src/client/graphics/layers/EventsDisplay.ts index f82b583de..71290b3e5 100644 --- a/src/client/graphics/layers/EventsDisplay.ts +++ b/src/client/graphics/layers/EventsDisplay.ts @@ -354,10 +354,8 @@ export class EventsDisplay extends LitElement implements Layer { } let description: string = event.message; - if (event.params !== undefined) { - if (event.message.startsWith("events_display.")) { - description = translateText(event.message, event.params); - } + if (event.message.startsWith("events_display.")) { + description = translateText(event.message, event.params ?? {}); } this.addEvent({