mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 11:10:42 +00:00
Difficulty translation key (#1959)
Move the key to name mapping for difficulties into the translation system. - [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
This commit is contained in:
committed by
evanpelle
parent
fc9eb2bec0
commit
fc8e6637eb
@@ -250,9 +250,9 @@
|
||||
},
|
||||
"difficulty": {
|
||||
"difficulty": "Difficulty",
|
||||
"Relaxed": "Relaxed",
|
||||
"Balanced": "Balanced",
|
||||
"Intense": "Intense",
|
||||
"Easy": "Relaxed",
|
||||
"Medium": "Balanced",
|
||||
"Hard": "Intense",
|
||||
"Impossible": "Impossible"
|
||||
},
|
||||
"game_mode": {
|
||||
|
||||
@@ -23,7 +23,6 @@ import {
|
||||
import { generateID } from "../core/Util";
|
||||
import "./components/baseComponents/Modal";
|
||||
import "./components/Difficulties";
|
||||
import { DifficultyDescription } from "./components/Difficulties";
|
||||
import "./components/Maps";
|
||||
import { JoinLobbyEvent } from "./Main";
|
||||
import { renderUnitTypeOptions } from "./utilities/RenderUnitTypeOptions";
|
||||
@@ -240,9 +239,7 @@ export class HostLobbyModal extends LitElement {
|
||||
.difficultyKey=${key}
|
||||
></difficulty-display>
|
||||
<p class="option-card-title">
|
||||
${translateText(
|
||||
`difficulty.${DifficultyDescription[key as keyof typeof DifficultyDescription]}`,
|
||||
)}
|
||||
${translateText(`difficulty.${key}`)}
|
||||
</p>
|
||||
</div>
|
||||
`,
|
||||
|
||||
@@ -16,11 +16,6 @@ import {
|
||||
import { UserSettings } from "../core/game/UserSettings";
|
||||
import { TeamCountConfig } from "../core/Schemas";
|
||||
import { generateID } from "../core/Util";
|
||||
import "./components/baseComponents/Button";
|
||||
import "./components/baseComponents/Modal";
|
||||
import "./components/Difficulties";
|
||||
import { DifficultyDescription } from "./components/Difficulties";
|
||||
import "./components/Maps";
|
||||
import { getCosmetics } from "./Cosmetics";
|
||||
import { FlagInput } from "./FlagInput";
|
||||
import { JoinLobbyEvent } from "./Main";
|
||||
@@ -150,9 +145,7 @@ export class SinglePlayerModal extends LitElement {
|
||||
.difficultyKey=${key}
|
||||
></difficulty-display>
|
||||
<p class="option-card-title">
|
||||
${translateText(
|
||||
`difficulty.${DifficultyDescription[key as keyof typeof DifficultyDescription]}`,
|
||||
)}
|
||||
${translateText(`difficulty.${key}`)}
|
||||
</p>
|
||||
</div>
|
||||
`,
|
||||
|
||||
@@ -1,13 +1,6 @@
|
||||
import { LitElement, css, html } from "lit";
|
||||
import { customElement, property } from "lit/decorators.js";
|
||||
|
||||
export enum DifficultyDescription {
|
||||
Easy = "Relaxed",
|
||||
Medium = "Balanced",
|
||||
Hard = "Intense",
|
||||
Impossible = "Impossible",
|
||||
}
|
||||
|
||||
@customElement("difficulty-display")
|
||||
export class DifficultyDisplay extends LitElement {
|
||||
@property({ type: String }) difficultyKey = "";
|
||||
|
||||
Reference in New Issue
Block a user