- Troops
+ ${translateText("player_panel.troops")}
-
Traitor
+
+ ${translateText("player_panel.traitor")}
+
- ${other.isTraitor() ? "Yes" : "No"}
+ ${other.isTraitor()
+ ? translateText("player_panel.yes")
+ : translateText("player_panel.no")}
- Embargo against you
+ ${translateText("player_panel.embargo")}
- ${other.hasEmbargoAgainst(myPlayer) ? "Yes" : "No"}
+ ${other.hasEmbargoAgainst(myPlayer)
+ ? translateText("player_panel.yes")
+ : translateText("player_panel.no")}
- Nukes sent by them to you
+ ${translateText("player_panel.nuke")}
${this.getTotalNukesSent(other.id())}
@@ -390,7 +399,7 @@ export class PlayerPanel extends LitElement implements Layer {
bg-opacity-50 bg-gray-700 hover:bg-opacity-70
text-white rounded-lg transition-colors"
>
- Stop trading
+ ${translateText("player_panel.stop_trade")}
`
: ""}
${!canEmbargo && other != myPlayer
@@ -401,7 +410,7 @@ export class PlayerPanel extends LitElement implements Layer {
bg-opacity-50 bg-gray-700 hover:bg-opacity-70
text-white rounded-lg transition-colors"
>
- Start trading
+ ${translateText("player_panel.start_trade")}
`
: ""}
diff --git a/src/client/graphics/layers/TopBar.ts b/src/client/graphics/layers/TopBar.ts
index d461cd939..83b6bea7a 100644
--- a/src/client/graphics/layers/TopBar.ts
+++ b/src/client/graphics/layers/TopBar.ts
@@ -1,5 +1,6 @@
import { LitElement, html } from "lit";
import { customElement } from "lit/decorators.js";
+import { translateText } from "../../../client/Utils";
import { GameView } from "../../../core/game/GameView";
import { renderNumber, renderTroops } from "../../Utils";
import { Layer } from "./Layer";
@@ -56,7 +57,9 @@ export class TopBar extends LitElement implements Layer {
-
Pop:
+
${translateText("control_panel.pop")}:
${renderTroops(myPlayer.population())} /
${renderTroops(maxPop)}
-
Gold:
+
${translateText("control_panel.gold")}:
${renderNumber(myPlayer.gold())}
(+${renderNumber(goldPerSecond)})${this._title || ""}
${this.innerHtml()}
-
-
+
+
`;
@@ -174,7 +179,7 @@ export class WinModal extends LitElement implements Layer {
myPlayer.hasSpawned()
) {
this.hasShownDeathModal = true;
- this._title = "You died";
+ this._title = translateText("win_modal.died");
this.show();
}
this.game.updatesSinceLastTick()[GameUpdateType.Win].forEach((wu) => {
@@ -183,9 +188,11 @@ export class WinModal extends LitElement implements Layer {
new SendWinnerEvent(wu.winner as Team, wu.allPlayersStats, "team"),
);
if (wu.winner == this.game.myPlayer()?.team()) {
- this._title = "Your team won!";
+ this._title = translateText("win_modal.your_team");
} else {
- this._title = `${wu.winner} team has won!`;
+ this._title = translateText("win_modal.other_team", {
+ team: wu.winner,
+ });
}
this.show();
} else {
@@ -196,9 +203,11 @@ export class WinModal extends LitElement implements Layer {
new SendWinnerEvent(winner.clientID(), wu.allPlayersStats, "player"),
);
if (winner == this.game.myPlayer()) {
- this._title = "You Won!";
+ this._title = translateText("win_modal.you_won");
} else {
- this._title = `${winner.name()} has won!`;
+ this._title = translateText("win_modal.you_won", {
+ player: winner.name(),
+ });
}
this.show();
}