From e7a32ef8df1952357c78326395592721a2274423 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E8=88=AA=E5=AE=87?= <3364451258@qq.com> Date: Sun, 31 May 2026 13:43:02 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A1=A5=E5=85=A8=20i18n=20=E5=9B=BD?= =?UTF-8?q?=E9=99=85=E5=8C=96=EF=BC=8C=E6=B6=88=E9=99=A4=E6=89=80=E6=9C=89?= =?UTF-8?q?=E7=A1=AC=E7=BC=96=E7=A0=81=E4=B8=AD=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.7 --- src/components/menu/AiGameSetup.tsx | 8 ++++---- src/components/menu/LoadReplay.tsx | 2 +- src/components/menu/LocalGameSetup.tsx | 2 +- src/components/menu/OnlineSetup.tsx | 8 ++++---- src/components/replay/ReplayView.tsx | 2 +- src/i18n/en.json | 14 +++++++++++++- src/i18n/zh-CN.json | 14 +++++++++++++- 7 files changed, 37 insertions(+), 13 deletions(-) diff --git a/src/components/menu/AiGameSetup.tsx b/src/components/menu/AiGameSetup.tsx index 49cf81b..a55974a 100644 --- a/src/components/menu/AiGameSetup.tsx +++ b/src/components/menu/AiGameSetup.tsx @@ -42,10 +42,10 @@ export default function AiGameSetup({ onBack, onStart }: Props) {
- +
); diff --git a/src/components/menu/LoadReplay.tsx b/src/components/menu/LoadReplay.tsx index 951235e..0129a06 100644 --- a/src/components/menu/LoadReplay.tsx +++ b/src/components/menu/LoadReplay.tsx @@ -38,7 +38,7 @@ export default function LoadReplay({ onBack, onStart }: Props) {

{t('menu.load_replay')}

- +
); } diff --git a/src/components/menu/LocalGameSetup.tsx b/src/components/menu/LocalGameSetup.tsx index f6cfe00..05e273a 100644 --- a/src/components/menu/LocalGameSetup.tsx +++ b/src/components/menu/LocalGameSetup.tsx @@ -31,7 +31,7 @@ export default function LocalGameSetup({ onBack, onStart }: Props) {

{t('menu.local_game')}

- +
); diff --git a/src/components/menu/OnlineSetup.tsx b/src/components/menu/OnlineSetup.tsx index 92f5ac2..7959cd9 100644 --- a/src/components/menu/OnlineSetup.tsx +++ b/src/components/menu/OnlineSetup.tsx @@ -29,12 +29,12 @@ export default function OnlineSetup({ onBack, onStart }: Props) { return (

{t('menu.online_game')}

- +
- setIp(e.target.value)} placeholder="IP:端口" /> - + setIp(e.target.value)} placeholder={t('menu.ip_placeholder') as string} /> +
- +
); } diff --git a/src/components/replay/ReplayView.tsx b/src/components/replay/ReplayView.tsx index ba80729..120820e 100644 --- a/src/components/replay/ReplayView.tsx +++ b/src/components/replay/ReplayView.tsx @@ -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))} /> - + ); } diff --git a/src/i18n/en.json b/src/i18n/en.json index 888cd83..fafe6ce 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -1,12 +1,24 @@ { "app": { "title": "Gobang v2.0" }, + "common": { + "back": "Back", + "back_to_menu": "Back to Menu" + }, "menu": { "local_game": "Local 2-Player", "ai_game": "VS AI", "online_game": "Online", "online_game_disabled": "Online mode is under development", "load_replay": "Load Replay", - "settings": "Settings" + "settings": "Settings", + "host_room": "Create Room", + "join_room": "Join Room", + "ip_placeholder": "IP:Port" + }, + "ai_setup": { + "first_player": "First Player", + "black_first": "Black (First)", + "white_second": "White (Second)" }, "game": { "black_turn": "Black's Turn", diff --git a/src/i18n/zh-CN.json b/src/i18n/zh-CN.json index 9763b17..8824310 100644 --- a/src/i18n/zh-CN.json +++ b/src/i18n/zh-CN.json @@ -1,12 +1,24 @@ { "app": { "title": "五子棋 v2.0" }, + "common": { + "back": "返回", + "back_to_menu": "返回菜单" + }, "menu": { "local_game": "本地双人", "ai_game": "人机对战", "online_game": "网络对战", "online_game_disabled": "网络对战功能开发中", "load_replay": "加载棋谱", - "settings": "设置" + "settings": "设置", + "host_room": "创建房间", + "join_room": "加入房间", + "ip_placeholder": "IP:端口" + }, + "ai_setup": { + "first_player": "先手", + "black_first": "黑棋 (先手)", + "white_second": "白棋 (后手)" }, "game": { "black_turn": "黑棋回合",