fix(i18n): localize splash strings

This commit is contained in:
Supra4E8C
2026-02-14 00:24:52 +08:00
parent f003a34dc0
commit 3937a403b1
6 changed files with 20 additions and 5 deletions

View File

@@ -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) {
<div className={`splash-screen ${fadeOut ? 'fade-out' : ''}`}>
<div className="splash-content">
<img src={INLINE_LOGO_JPEG} alt="CPAMC" className="splash-logo" />
<h1 className="splash-title">CLI Proxy API</h1>
<p className="splash-subtitle">Management Center</p>
<h1 className="splash-title">{t('splash.title')}</h1>
<p className="splash-subtitle">{t('splash.subtitle')}</p>
<div className="splash-loader">
<div className="splash-loader-bar" />
</div>

View File

@@ -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"

View File

@@ -54,6 +54,10 @@
"login": "Центр управления CLI Proxy API",
"abbr": "CPAMC"
},
"splash": {
"title": "CLI Proxy API",
"subtitle": "Центр управления"
},
"auto_login": {
"title": "Автовход...",
"message": "Пытаемся подключиться к серверу, используя сохранённые данные"

View File

@@ -54,6 +54,10 @@
"login": "CLI Proxy API Management Center",
"abbr": "CPAMC"
},
"splash": {
"title": "CLI Proxy API",
"subtitle": "管理中心"
},
"auto_login": {
"title": "正在自动登录...",
"message": "正在使用本地保存的连接信息尝试连接服务器"

View File

@@ -188,8 +188,8 @@ export function LoginPage() {
/* 启动动画 */
<div className={styles.splashContent}>
<img src={INLINE_LOGO_JPEG} alt="CPAMC" className={styles.splashLogo} />
<h1 className={styles.splashTitle}>CLI Proxy API</h1>
<p className={styles.splashSubtitle}>Management Center</p>
<h1 className={styles.splashTitle}>{t('splash.title')}</h1>
<p className={styles.splashSubtitle}>{t('splash.subtitle')}</p>
<div className={styles.splashLoader}>
<div className={styles.splashLoaderBar} />
</div>

View File

@@ -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');
}
};