mirror of
https://github.com/router-for-me/Cli-Proxy-API-Management-Center.git
synced 2026-02-19 19:20:49 +08:00
fix(i18n): localize splash strings
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import { useEffect } from 'react';
|
import { useEffect } from 'react';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
import { INLINE_LOGO_JPEG } from '@/assets/logoInline';
|
import { INLINE_LOGO_JPEG } from '@/assets/logoInline';
|
||||||
import './SplashScreen.scss';
|
import './SplashScreen.scss';
|
||||||
|
|
||||||
@@ -10,6 +11,8 @@ interface SplashScreenProps {
|
|||||||
const FADE_OUT_DURATION = 400;
|
const FADE_OUT_DURATION = 400;
|
||||||
|
|
||||||
export function SplashScreen({ onFinish, fadeOut = false }: SplashScreenProps) {
|
export function SplashScreen({ onFinish, fadeOut = false }: SplashScreenProps) {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!fadeOut) return;
|
if (!fadeOut) return;
|
||||||
const finishTimer = setTimeout(() => {
|
const finishTimer = setTimeout(() => {
|
||||||
@@ -25,8 +28,8 @@ export function SplashScreen({ onFinish, fadeOut = false }: SplashScreenProps) {
|
|||||||
<div className={`splash-screen ${fadeOut ? 'fade-out' : ''}`}>
|
<div className={`splash-screen ${fadeOut ? 'fade-out' : ''}`}>
|
||||||
<div className="splash-content">
|
<div className="splash-content">
|
||||||
<img src={INLINE_LOGO_JPEG} alt="CPAMC" className="splash-logo" />
|
<img src={INLINE_LOGO_JPEG} alt="CPAMC" className="splash-logo" />
|
||||||
<h1 className="splash-title">CLI Proxy API</h1>
|
<h1 className="splash-title">{t('splash.title')}</h1>
|
||||||
<p className="splash-subtitle">Management Center</p>
|
<p className="splash-subtitle">{t('splash.subtitle')}</p>
|
||||||
<div className="splash-loader">
|
<div className="splash-loader">
|
||||||
<div className="splash-loader-bar" />
|
<div className="splash-loader-bar" />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -54,6 +54,10 @@
|
|||||||
"login": "CLI Proxy API Management Center",
|
"login": "CLI Proxy API Management Center",
|
||||||
"abbr": "CPAMC"
|
"abbr": "CPAMC"
|
||||||
},
|
},
|
||||||
|
"splash": {
|
||||||
|
"title": "CLI Proxy API",
|
||||||
|
"subtitle": "Management Center"
|
||||||
|
},
|
||||||
"auto_login": {
|
"auto_login": {
|
||||||
"title": "Auto Login in Progress...",
|
"title": "Auto Login in Progress...",
|
||||||
"message": "Attempting to connect to server using locally saved connection information"
|
"message": "Attempting to connect to server using locally saved connection information"
|
||||||
|
|||||||
@@ -54,6 +54,10 @@
|
|||||||
"login": "Центр управления CLI Proxy API",
|
"login": "Центр управления CLI Proxy API",
|
||||||
"abbr": "CPAMC"
|
"abbr": "CPAMC"
|
||||||
},
|
},
|
||||||
|
"splash": {
|
||||||
|
"title": "CLI Proxy API",
|
||||||
|
"subtitle": "Центр управления"
|
||||||
|
},
|
||||||
"auto_login": {
|
"auto_login": {
|
||||||
"title": "Автовход...",
|
"title": "Автовход...",
|
||||||
"message": "Пытаемся подключиться к серверу, используя сохранённые данные"
|
"message": "Пытаемся подключиться к серверу, используя сохранённые данные"
|
||||||
|
|||||||
@@ -54,6 +54,10 @@
|
|||||||
"login": "CLI Proxy API Management Center",
|
"login": "CLI Proxy API Management Center",
|
||||||
"abbr": "CPAMC"
|
"abbr": "CPAMC"
|
||||||
},
|
},
|
||||||
|
"splash": {
|
||||||
|
"title": "CLI Proxy API",
|
||||||
|
"subtitle": "管理中心"
|
||||||
|
},
|
||||||
"auto_login": {
|
"auto_login": {
|
||||||
"title": "正在自动登录...",
|
"title": "正在自动登录...",
|
||||||
"message": "正在使用本地保存的连接信息尝试连接服务器"
|
"message": "正在使用本地保存的连接信息尝试连接服务器"
|
||||||
|
|||||||
@@ -188,8 +188,8 @@ export function LoginPage() {
|
|||||||
/* 启动动画 */
|
/* 启动动画 */
|
||||||
<div className={styles.splashContent}>
|
<div className={styles.splashContent}>
|
||||||
<img src={INLINE_LOGO_JPEG} alt="CPAMC" className={styles.splashLogo} />
|
<img src={INLINE_LOGO_JPEG} alt="CPAMC" className={styles.splashLogo} />
|
||||||
<h1 className={styles.splashTitle}>CLI Proxy API</h1>
|
<h1 className={styles.splashTitle}>{t('splash.title')}</h1>
|
||||||
<p className={styles.splashSubtitle}>Management Center</p>
|
<p className={styles.splashSubtitle}>{t('splash.subtitle')}</p>
|
||||||
<div className={styles.splashLoader}>
|
<div className={styles.splashLoader}>
|
||||||
<div className={styles.splashLoaderBar} />
|
<div className={styles.splashLoaderBar} />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -190,7 +190,7 @@ export function OAuthPage() {
|
|||||||
await navigator.clipboard.writeText(url);
|
await navigator.clipboard.writeText(url);
|
||||||
showNotification(t('notification.link_copied'), 'success');
|
showNotification(t('notification.link_copied'), 'success');
|
||||||
} catch {
|
} catch {
|
||||||
showNotification('Copy failed', 'error');
|
showNotification(t('notification.copy_failed'), 'error');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user