Skip to content

Commit 5b1577e

Browse files
authored
Update HeadsUpMessage.ts to support translations (openfrontio#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
1 parent 9c4317a commit 5b1577e

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

resources/lang/debug.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,5 +164,8 @@
164164
"Balanced": "difficulty.Balanced",
165165
"Intense": "difficulty.Intense",
166166
"Impossible": "difficulty.Impossible"
167+
},
168+
"heads_up_message": {
169+
"choose_spawn": "heads_up_message.choose_spawn"
167170
}
168171
}

resources/lang/en.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,5 +428,8 @@
428428
"copied": "Copied!",
429429
"failed_copy": "Failed to copy",
430430
"desync_notice": "You are desynced from other players. What you see might differ from other players."
431+
},
432+
"heads_up_message": {
433+
"choose_spawn": "Choose a starting location"
431434
}
432435
}

src/client/graphics/layers/HeadsUpMessage.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { LitElement, html } from "lit";
22
import { customElement, state } from "lit/decorators.js";
33
import { GameView } from "../../../core/game/GameView";
4+
import { translateText } from "../../Utils";
45
import { Layer } from "./Layer";
56

67
@customElement("heads-up-message")
@@ -39,7 +40,7 @@ export class HeadsUpMessage extends LitElement implements Layer {
3940
backdrop-blur-md text-white text-md lg:text-xl p-1 lg:p-2"
4041
@contextmenu=${(e) => e.preventDefault()}
4142
>
42-
Choose a starting location
43+
${translateText("heads_up_message.choose_spawn")}
4344
</div>
4445
`;
4546
}

0 commit comments

Comments
 (0)