From 724f0235a27362ea31c154af6f282a3f2274d2d9 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 66771cfbc..cb26fc98a 100644 --- a/src/client/graphics/layers/EventsDisplay.ts +++ b/src/client/graphics/layers/EventsDisplay.ts @@ -360,10 +360,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({