diff --git a/public/i18n/en.json b/public/i18n/en.json index 6b731e88..a11afad0 100644 --- a/public/i18n/en.json +++ b/public/i18n/en.json @@ -1075,5 +1075,8 @@ "联防:{names}": "Unite: {names}", "剩余资金": "Funds Left", "继续整备": "Keep Preparing", - "还有 {funds} 资金未使用。休整期结束时,本回合的剩余资金将清零。确定准备就绪吗?": "You still have {funds} unspent Funds. The round's leftover Funds are cleared when the Rest Phase ends. Ready anyway?" + "还有 {funds} 资金未使用。休整期结束时,本回合的剩余资金将清零。确定准备就绪吗?": "You still have {funds} unspent Funds. The round's leftover Funds are cleared when the Rest Phase ends. Ready anyway?", + "选择「{name}」的朝向": "Choose {name}'s facing", + "选择朝向": "Choose a facing", + "朝向:{dir}": "Facing: {dir}" } diff --git a/public/js/render/app.js b/public/js/render/app.js index 0b616e67..09536473 100644 --- a/public/js/render/app.js +++ b/public/js/render/app.js @@ -134,6 +134,7 @@ import { CAMERA_MS, BOARD3D_STABLE_MS, BOARD3D_RETRY_MS, PEN_CAMERA_MS, RANGE_GR import { boardPreference, switchableBox, bandFor, fieldRows, boardArea, viewKind, penShown, leaderShown } from './app/view.js'; import { renderInfo, FORCED_EXIT, showsDeathFx } from './app/info.js'; import { resolveAssets, makeData, withTimeout, QUALITY_RES, BOARD_RES, releaseGl } from './app/host.js'; +import { t } from '../../../shared/i18n.js'; export { ensurePixi } from './app/pixi.js'; export { PEN_CAMERA_MS, LEADER_HIT_STYLE, DRAG_HOLD_TILES } from './app/tune.js'; @@ -185,7 +186,7 @@ export async function createFieldView(host, options = {}) { canvas.style.height = '100%'; canvas.style.touchAction = 'none'; canvas.style.userSelect = 'none'; - canvas.setAttribute('aria-label', '战场'); + canvas.setAttribute('aria-label', t('战场')); canvas.style.position = 'relative'; canvas.style.zIndex = '1'; host.appendChild(canvas); diff --git a/public/js/ui/facing.js b/public/js/ui/facing.js index 58c1c014..bd403a8d 100644 --- a/public/js/ui/facing.js +++ b/public/js/ui/facing.js @@ -14,6 +14,7 @@ import { GEO } from '../../../shared/constants.js'; import { attackRangeGrid } from '../../../shared/loadoutRecord.js'; +import { N_ } from '../../../shared/i18n.js'; export const DIRS = Object.freeze(['UP', 'RIGHT', 'DOWN', 'LEFT']); export const DEFAULT_DIR = 'RIGHT'; @@ -29,7 +30,7 @@ export const DIR_VEC = Object.freeze({ }); /** Chinese label (for aria / tooltips). */ -export const DIR_LABEL = Object.freeze({ UP: '上', RIGHT: '右', DOWN: '下', LEFT: '左' }); +export const DIR_LABEL = Object.freeze({ UP: N_('上'), RIGHT: N_('右'), DOWN: N_('下'), LEFT: N_('左') }); /** Normalise any direction spelling ('up', 'Right', 1/−1 facing) to UP|RIGHT|DOWN|LEFT; unknown → `fallback`. */ export function normDir(d, fallback = DEFAULT_DIR) { diff --git a/public/js/ui/facingWheel.js b/public/js/ui/facingWheel.js index e5efc5c5..73a6292f 100644 --- a/public/js/ui/facingWheel.js +++ b/public/js/ui/facingWheel.js @@ -25,6 +25,7 @@ import { useEffect, useLayoutEffect, useRef, useState } from '../../vendor/hooks import { html } from './components.js'; import { LocalSprite } from './gameComponents.js'; import { DIRS, DIR_LABEL, DEAD_ZONE_TILES, dirFromDelta, dirFromKey, rangeTiles, normDir, boardDir, viewMirrored } from './facing.js'; +import { t } from '../../../shared/i18n.js'; const cx = (...p) => p.flat().filter(Boolean).join(' '); const rawOf = (view) => (view && view.raw) || view || null; @@ -249,7 +250,7 @@ export function FacingWheel({ view, row, col, grid, name = '', onPreview, onComm const outside = !!drag && !!dir; const box = half * 2; - return html`
暂无敌方情报
`} + ${models.length ? null : html`${t('暂无敌方情报')}
`}