mirror of
https://github.com/LHY0125/Gobang-Game.git
synced 2026-06-29 00:45:55 +08:00
fix: 补全 i18n 国际化,消除所有硬编码中文
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -42,10 +42,10 @@ export default function AiGameSetup({ onBack, onStart }: Props) {
|
||||
</select>
|
||||
</label>
|
||||
<label>
|
||||
先手:
|
||||
{t('ai_setup.first_player')}:
|
||||
<select value={playerColor} onChange={(e) => setPlayerColor(e.target.value as Color)}>
|
||||
<option value="Black">黑棋 (先手)</option>
|
||||
<option value="White">白棋 (后手)</option>
|
||||
<option value="Black">{t('ai_setup.black_first')}</option>
|
||||
<option value="White">{t('ai_setup.white_second')}</option>
|
||||
</select>
|
||||
</label>
|
||||
<label>
|
||||
@@ -54,7 +54,7 @@ export default function AiGameSetup({ onBack, onStart }: Props) {
|
||||
</label>
|
||||
<div className="setup-actions">
|
||||
<button onClick={handleStart}>{t('game.new_game')}</button>
|
||||
<button onClick={onBack}>返回</button>
|
||||
<button onClick={onBack}>{t('common.back')}</button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -38,7 +38,7 @@ export default function LoadReplay({ onBack, onStart }: Props) {
|
||||
<div className="setup-panel">
|
||||
<h2>{t('menu.load_replay')}</h2>
|
||||
<input ref={fileRef} type="file" accept=".json" onChange={handleFile} />
|
||||
<button onClick={onBack} style={{ marginTop: 12 }}>返回</button>
|
||||
<button onClick={onBack} style={{ marginTop: 12 }}>{t('common.back')}</button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ export default function LocalGameSetup({ onBack, onStart }: Props) {
|
||||
<h2>{t('menu.local_game')}</h2>
|
||||
<div className="setup-actions">
|
||||
<button onClick={handleStart}>{t('game.new_game')}</button>
|
||||
<button onClick={onBack}>返回</button>
|
||||
<button onClick={onBack}>{t('common.back')}</button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -29,12 +29,12 @@ export default function OnlineSetup({ onBack, onStart }: Props) {
|
||||
return (
|
||||
<div className="setup-panel">
|
||||
<h2>{t('menu.online_game')}</h2>
|
||||
<button onClick={handleHost}>创建房间</button>
|
||||
<button onClick={handleHost}>{t('menu.host_room')}</button>
|
||||
<div style={{ display: 'flex', gap: 8, marginTop: 12 }}>
|
||||
<input value={ip} onChange={(e) => setIp(e.target.value)} placeholder="IP:端口" />
|
||||
<button onClick={handleJoin} disabled={!ip}>加入房间</button>
|
||||
<input value={ip} onChange={(e) => setIp(e.target.value)} placeholder={t('menu.ip_placeholder') as string} />
|
||||
<button onClick={handleJoin} disabled={!ip}>{t('menu.join_room')}</button>
|
||||
</div>
|
||||
<button onClick={onBack} style={{ marginTop: 12 }}>返回</button>
|
||||
<button onClick={onBack} style={{ marginTop: 12 }}>{t('common.back')}</button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ export default function ReplayView({ onBackToMenu }: Props) {
|
||||
onPrev={() => setReplayStep(Math.max(0, step - 1))}
|
||||
onNext={() => setReplayStep(Math.min(moves.length, step + 1))}
|
||||
/>
|
||||
<button onClick={onBackToMenu}>返回菜单</button>
|
||||
<button onClick={onBackToMenu}>{t('common.back_to_menu')}</button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user