diff --git a/resources/lang/en.json b/resources/lang/en.json index 275f12541..d634a850c 100644 --- a/resources/lang/en.json +++ b/resources/lang/en.json @@ -319,5 +319,78 @@ "saving_for_mirv": "[P1] is saving up to launch a MIRV.", "mirv_ready": "[P1] has enough gold to launch a MIRV!" } + }, + "build_menu": { + "desc": { + "atom_bomb": "Small explosion", + "hydrogen_bomb": "Large explosion", + "mirv": "Huge explosion, only targets selected player", + "missile_silo": "Used to launch nukes", + "sam_launcher": "Defends against incoming nukes", + "warship": "Captures trade ships, destroys ships and boats", + "port": "Sends trade ships to allies to generate gold", + "defense_post": "Increase defenses of nearby borders", + "city": "Increase max population" + }, + "not_enough_money": "Not enough money" + }, + "win_modal": { + "died": "You died", + "your_team": "Your team won!", + "other_team": "{team} team has won!", + "you_won": "You Won!", + "other_won": "{player} has won!", + "exit": "Exit Game", + "keep": "Keep Playing" + }, + "leaderboard": { + "title": "Leaderboard", + "hide": "Hide", + "rank": "Rank", + "player": "Player", + "owned": "Owned", + "gold": "Gold", + "troops": "Troops" + }, + "player_info_overlay": { + "type": "Type", + "bot": "Bot", + "nation": "Nation", + "player": "Player", + "team": "Team", + "d_troops": "Defending troops", + "a_troops": "Attacking troops", + "gold": "Gold", + "ports": "Ports", + "cities": "Cities", + "missile_launchers": "Missile launchers", + "sams": "SAMs", + "health": "Health", + "attitude": "Attitude" + }, + "relation": { + "hostile": "Hostile", + "distrustful": "Distrustful", + "neutral": "Neutral", + "friendly": "Friendly", + "default": "Default" + }, + "control_panel": { + "pop": "Pop", + "gold": "Gold", + "troops": "Troops", + "workers": "Workers", + "attack_ratio": "Attack Ratio" + }, + "player_panel": { + "gold": "Gold", + "troops": "Troops", + "traitor": "Traitor", + "embargo": "Embargo against you", + "nuke": "Nukes sent by them to you", + "start_trade": "Start trading", + "stop_trade": "Stop trading", + "yes": "Yes", + "no": "No" } } diff --git a/resources/lang/ja.json b/resources/lang/ja.json index 737470e14..dd5f9293d 100644 --- a/resources/lang/ja.json +++ b/resources/lang/ja.json @@ -319,5 +319,78 @@ "saving_for_mirv": "[P1]はMIRVを発射するために貯金している。", "mirv_ready": "[P1]はMIRVを発射できるだけのお金を持っている!" } + }, + "build_menu": { + "desc": { + "atom_bomb": "小規模な爆発", + "hydrogen_bomb": "大規模な爆発", + "mirv": "指定したプレイヤーのみを狙う超大規模な爆発", + "missile_silo": "核ミサイルの発射に使用される", + "sam_launcher": "飛来する核ミサイルを迎撃する", + "warship": "貿易船を捕獲し、敵の船やボートを破壊する", + "port": "同盟国に貿易船を送り、ゴールドを生成する", + "defense_post": "近くの国境の防御を強化する", + "city": "最大人口を増加させる" + }, + "not_enough_money": "資金不足" + }, + "win_modal": { + "died": "あなたは死んでしまった", + "your_team": "あなたのチームの勝利!", + "other_team": "{team}チームが勝利しました。", + "you_won": "勝利!", + "other_won": "{player}の勝利!", + "exit": "ゲームから退出", + "keep": "観戦する" + }, + "leaderboard": { + "title": "ランキング", + "hide": "隠す", + "rank": "順位", + "player": "プレイヤー", + "owned": "領土", + "gold": "ゴールド", + "troops": "兵士" + }, + "player_info_overlay": { + "type": "タイプ", + "bot": "ボット", + "nation": "国家", + "player": "プレイヤー", + "team": "チーム", + "d_troops": "防衛兵士数", + "a_troops": "攻撃兵士数", + "gold": "資金", + "ports": "港", + "cities": "都市", + "missile_launchers": "ミサイル格納庫", + "sams": "SAM", + "health": "体力", + "attitude": "態度" + }, + "relation": { + "hostile": "敵対的", + "distrustful": "不信", + "neutral": "中立", + "friendly": "友好的", + "default": "デフォルト" + }, + "control_panel": { + "pop": "人口", + "gold": "資金", + "troops": "兵士", + "workers": "労働者", + "attack_ratio": "攻撃比率" + }, + "player_panel": { + "gold": "資金", + "troops": "兵士", + "traitor": "裏切り者かどうか", + "embargo": "あなたへの禁輸措置があるかどうか", + "nuke": "相手からあなたへの核攻撃数", + "start_trade": "貿易を開始", + "stop_trade": "貿易を停止", + "yes": "はい", + "no": "いいえ" } } diff --git a/src/client/graphics/layers/BuildMenu.ts b/src/client/graphics/layers/BuildMenu.ts index a4105c46f..e051f6519 100644 --- a/src/client/graphics/layers/BuildMenu.ts +++ b/src/client/graphics/layers/BuildMenu.ts @@ -10,6 +10,7 @@ import atomBombIcon from "../../../../resources/images/NukeIconWhite.svg"; import portIcon from "../../../../resources/images/PortIcon.svg"; import samlauncherIcon from "../../../../resources/images/SamLauncherIconWhite.svg"; import shieldIcon from "../../../../resources/images/ShieldIconWhite.svg"; +import { translateText } from "../../../client/Utils"; import { EventBus } from "../../../core/EventBus"; import { Cell, PlayerActions, UnitType } from "../../../core/game/Game"; import { TileRef } from "../../../core/game/GameMap"; @@ -22,6 +23,7 @@ interface BuildItemDisplay { unitType: UnitType; icon: string; description?: string; + key?: string; countable?: boolean; } @@ -30,56 +32,65 @@ const buildTable: BuildItemDisplay[][] = [ { unitType: UnitType.AtomBomb, icon: atomBombIcon, - description: "Small explosion", + description: "build_menu.desc.atom_bomb", + key: "unit_type.atom_bomb", countable: false, }, { unitType: UnitType.MIRV, icon: mirvIcon, - description: "Huge explosion, only targets selected player", + description: "build_menu.desc.mirv", + key: "unit_type.mirv", countable: false, }, { unitType: UnitType.HydrogenBomb, icon: hydrogenBombIcon, - description: "Large explosion", + description: "build_menu.desc.hydrogen_bomb", + key: "unit_type.hydrogen_bomb", countable: false, }, { unitType: UnitType.Warship, icon: warshipIcon, - description: "Captures trade ships, destroys ships and boats", + description: "build_menu.desc.warship", + key: "unit_type.warship", countable: true, }, { unitType: UnitType.Port, icon: portIcon, - description: "Sends trade ships to allies to generate gold", + description: "build_menu.desc.port", + key: "unit_type.port", countable: true, }, { unitType: UnitType.MissileSilo, icon: missileSiloIcon, - description: "Used to launch nukes", + description: "build_menu.desc.missile_silo", + key: "unit_type.missile_silo", countable: true, }, // needs new icon { unitType: UnitType.SAMLauncher, icon: samlauncherIcon, - description: "Defends against incoming nukes", + description: "build_menu.desc.sam_launcher", + key: "unit_type.sam_launcher", countable: true, }, { unitType: UnitType.DefensePost, icon: shieldIcon, - description: "Increase defenses of nearby borders", + description: "build_menu.desc.defense_post", + key: "unit_type.defense_post", countable: true, }, { unitType: UnitType.City, icon: cityIcon, - description: "Increase max population", + description: "build_menu.desc.city", + key: "unit_type.city", countable: true, }, ], @@ -347,7 +358,9 @@ export class BuildMenu extends LitElement implements Layer { class="build-button" @click=${() => this.onBuildSelected(item)} ?disabled=${!this.canBuild(item)} - title=${!this.canBuild(item) ? "Not enough money" : ""} + title=${!this.canBuild(item) + ? translateText("build_menu.not_enough_money") + : ""} > - ${item.unitType} - ${item.description} + ${translateText(item.key)} + ${translateText(item.description)} ${renderNumber( this.game && this.game.myPlayer() ? this.cost(item) : 0, diff --git a/src/client/graphics/layers/ControlPanel.ts b/src/client/graphics/layers/ControlPanel.ts index fac9fb6b6..1fa6e1185 100644 --- a/src/client/graphics/layers/ControlPanel.ts +++ b/src/client/graphics/layers/ControlPanel.ts @@ -1,5 +1,6 @@ import { LitElement, html } from "lit"; import { customElement, state } from "lit/decorators.js"; +import { translateText } from "../../../client/Utils"; import { EventBus } from "../../../core/EventBus"; import { GameView } from "../../../core/game/GameView"; import { ClientID } from "../../../core/Schemas"; @@ -210,7 +211,9 @@ export class ControlPanel extends LitElement implements Layer { >