mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 12:10:46 +00:00
Adding unit info modal translation support. (#1122)
## Description: Adding translation support for unit info modal. ## 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 Regression test to make sure UI is still displaying as expected  ## Please put your Discord username so you can be contacted if a bug or regression is found: sii
This commit is contained in:
@@ -406,6 +406,13 @@
|
||||
"retreating": "retreating",
|
||||
"boat": "Boat"
|
||||
},
|
||||
"unit_info_modal": {
|
||||
"structure_info": "Structure Info",
|
||||
"unit_type_unknown": "Unknown",
|
||||
"close": "Close",
|
||||
"cooldown": "Cooldown",
|
||||
"type": "Type"
|
||||
},
|
||||
"relation": {
|
||||
"hostile": "Hostile",
|
||||
"distrustful": "Distrustful",
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { LitElement, css, html } from "lit";
|
||||
import { customElement, property } from "lit/decorators.js";
|
||||
import { translateText } from "../../../client/Utils";
|
||||
import { UnitType } from "../../../core/game/Game";
|
||||
import { GameView, UnitView } from "../../../core/game/GameView";
|
||||
import { Layer } from "./Layer";
|
||||
@@ -133,14 +134,17 @@ export class UnitInfoModal extends LitElement implements Layer {
|
||||
.x}px; top: ${this.y}px; position: absolute;"
|
||||
>
|
||||
<div style="margin-bottom: 8px; font-size: 16px; font-weight: bold;">
|
||||
Structure Info
|
||||
${translateText("unit_info_modal.structure_info")}
|
||||
</div>
|
||||
<div style="margin-bottom: 4px;">
|
||||
<strong>Type:</strong> ${this.unit.type?.() ?? "Unknown"}
|
||||
<strong>${translateText("unit_info_modal.type")}:</strong>
|
||||
${translateText(+"unit_type." + this.unit.type?.().toLowerCase()) ??
|
||||
translateText("unit_info_modal.unit_type_unknown")}
|
||||
</div>
|
||||
${secondsLeft > 0
|
||||
? html`<div style="margin-bottom: 4px;">
|
||||
<strong>Cooldown:</strong> ${secondsLeft}s
|
||||
<strong>${translateText("unit_info_modal.cooldown")}</strong>
|
||||
${secondsLeft}s
|
||||
</div>`
|
||||
: ""}
|
||||
<div style="margin-top: 14px; display: flex; justify-content: center;">
|
||||
@@ -152,10 +156,10 @@ export class UnitInfoModal extends LitElement implements Layer {
|
||||
}
|
||||
}}
|
||||
class="close-button"
|
||||
title="Close"
|
||||
title="${translateText("unit_info_modal.close")}"
|
||||
style="width: 100px; height: 32px;"
|
||||
>
|
||||
CLOSE
|
||||
${translateText("unit_info_modal.close")}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user