mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 14:50:44 +00:00
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: <img width="383" height="179" alt="image" src="https://github.com/user-attachments/assets/22a4dac5-ae68-40e1-bd11-f0f13e93b5fd" /> ## 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
This commit is contained in:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user