From 3937a403b12b7b6a42ea320f18164028cab722d8 Mon Sep 17 00:00:00 2001 From: Supra4E8C Date: Sat, 14 Feb 2026 00:24:52 +0800 Subject: [PATCH] fix(i18n): localize splash strings --- src/components/common/SplashScreen.tsx | 7 +++++-- src/i18n/locales/en.json | 4 ++++ src/i18n/locales/ru.json | 4 ++++ src/i18n/locales/zh-CN.json | 4 ++++ src/pages/LoginPage.tsx | 4 ++-- src/pages/OAuthPage.tsx | 2 +- 6 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/components/common/SplashScreen.tsx b/src/components/common/SplashScreen.tsx index ffee1d3..5de06e4 100644 --- a/src/components/common/SplashScreen.tsx +++ b/src/components/common/SplashScreen.tsx @@ -1,4 +1,5 @@ import { useEffect } from 'react'; +import { useTranslation } from 'react-i18next'; import { INLINE_LOGO_JPEG } from '@/assets/logoInline'; import './SplashScreen.scss'; @@ -10,6 +11,8 @@ interface SplashScreenProps { const FADE_OUT_DURATION = 400; export function SplashScreen({ onFinish, fadeOut = false }: SplashScreenProps) { + const { t } = useTranslation(); + useEffect(() => { if (!fadeOut) return; const finishTimer = setTimeout(() => { @@ -25,8 +28,8 @@ export function SplashScreen({ onFinish, fadeOut = false }: SplashScreenProps) {
CPAMC -

CLI Proxy API

-

Management Center

+

{t('splash.title')}

+

{t('splash.subtitle')}

diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json index 297448a..9407a9b 100644 --- a/src/i18n/locales/en.json +++ b/src/i18n/locales/en.json @@ -54,6 +54,10 @@ "login": "CLI Proxy API Management Center", "abbr": "CPAMC" }, + "splash": { + "title": "CLI Proxy API", + "subtitle": "Management Center" + }, "auto_login": { "title": "Auto Login in Progress...", "message": "Attempting to connect to server using locally saved connection information" diff --git a/src/i18n/locales/ru.json b/src/i18n/locales/ru.json index c299e3f..6ccd1de 100644 --- a/src/i18n/locales/ru.json +++ b/src/i18n/locales/ru.json @@ -54,6 +54,10 @@ "login": "Центр управления CLI Proxy API", "abbr": "CPAMC" }, + "splash": { + "title": "CLI Proxy API", + "subtitle": "Центр управления" + }, "auto_login": { "title": "Автовход...", "message": "Пытаемся подключиться к серверу, используя сохранённые данные" diff --git a/src/i18n/locales/zh-CN.json b/src/i18n/locales/zh-CN.json index a3b65b5..9a2b58a 100644 --- a/src/i18n/locales/zh-CN.json +++ b/src/i18n/locales/zh-CN.json @@ -54,6 +54,10 @@ "login": "CLI Proxy API Management Center", "abbr": "CPAMC" }, + "splash": { + "title": "CLI Proxy API", + "subtitle": "管理中心" + }, "auto_login": { "title": "正在自动登录...", "message": "正在使用本地保存的连接信息尝试连接服务器" diff --git a/src/pages/LoginPage.tsx b/src/pages/LoginPage.tsx index 32068dc..c746bf7 100644 --- a/src/pages/LoginPage.tsx +++ b/src/pages/LoginPage.tsx @@ -188,8 +188,8 @@ export function LoginPage() { /* 启动动画 */
CPAMC -

CLI Proxy API

-

Management Center

+

{t('splash.title')}

+

{t('splash.subtitle')}

diff --git a/src/pages/OAuthPage.tsx b/src/pages/OAuthPage.tsx index d92bf9a..0abb268 100644 --- a/src/pages/OAuthPage.tsx +++ b/src/pages/OAuthPage.tsx @@ -190,7 +190,7 @@ export function OAuthPage() { await navigator.clipboard.writeText(url); showNotification(t('notification.link_copied'), 'success'); } catch { - showNotification('Copy failed', 'error'); + showNotification(t('notification.copy_failed'), 'error'); } };