fix(i18n): 补齐九种语言的翻译并修复国际化检查
补齐页面缺译,统一动态文案的整句插值方式。
This commit is contained in:
@@ -17,6 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import React from 'react';
|
||||
import { Sparkles } from 'lucide-react';
|
||||
|
||||
@@ -37,34 +38,37 @@ const AuthCardHeader = ({
|
||||
logoNode,
|
||||
wrapperClassName = 'mb-5',
|
||||
logoWrapperClassName = 'mb-3',
|
||||
}) => (
|
||||
<div
|
||||
className={`flex flex-col items-center justify-center ${wrapperClassName}`}
|
||||
>
|
||||
<div className={`relative ${logoWrapperClassName}`}>
|
||||
{/* Logo 光环 */}
|
||||
<div className='absolute -inset-1.5 bg-gradient-to-r from-brand-from/30 to-brand-to/30 rounded-xl blur-md opacity-60' />
|
||||
<div className='relative p-2 bg-white dark:bg-neutral-800 rounded-xl shadow-md'>
|
||||
{logoNode || (
|
||||
<img
|
||||
src={logo}
|
||||
alt='Logo'
|
||||
className='h-10 w-10 rounded-lg object-cover'
|
||||
/>
|
||||
)}
|
||||
}) => {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<div
|
||||
className={`flex flex-col items-center justify-center ${wrapperClassName}`}
|
||||
>
|
||||
<div className={`relative ${logoWrapperClassName}`}>
|
||||
{/* Logo 光环 */}
|
||||
<div className='absolute -inset-1.5 bg-gradient-to-r from-brand-from/30 to-brand-to/30 rounded-xl blur-md opacity-60' />
|
||||
<div className='relative p-2 bg-white dark:bg-neutral-800 rounded-xl shadow-md'>
|
||||
{logoNode || (
|
||||
<img
|
||||
src={logo}
|
||||
alt={t('网站标志')}
|
||||
className='h-10 w-10 rounded-lg object-cover'
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
<Sparkles
|
||||
size={14}
|
||||
className='absolute -top-0.5 -right-0.5 text-amber-400 motion-safe:animate-pulse'
|
||||
/>
|
||||
</div>
|
||||
<Sparkles
|
||||
size={14}
|
||||
className='absolute -top-0.5 -right-0.5 text-amber-400 motion-safe:animate-pulse'
|
||||
/>
|
||||
<h4 className='text-xl font-bold text-gray-800 dark:text-white tracking-tight mb-0.5'>
|
||||
{title}
|
||||
</h4>
|
||||
<p className='auth-card-subtitle text-gray-500 dark:text-gray-400 text-xs'>
|
||||
{subtitle}
|
||||
</p>
|
||||
</div>
|
||||
<h4 className='text-xl font-bold text-gray-800 dark:text-white tracking-tight mb-0.5'>
|
||||
{title}
|
||||
</h4>
|
||||
<p className='auth-card-subtitle text-gray-500 dark:text-gray-400 text-xs'>
|
||||
{subtitle}
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
);
|
||||
};
|
||||
|
||||
export default AuthCardHeader;
|
||||
|
||||
@@ -704,7 +704,7 @@ const LoginForm = () => {
|
||||
<Suspense
|
||||
fallback={
|
||||
<div className='flex justify-center my-2 h-10 items-center text-gray-400 text-xs'>
|
||||
Loading...
|
||||
{t('加载中...')}
|
||||
</div>
|
||||
}
|
||||
>
|
||||
|
||||
@@ -122,7 +122,11 @@ const PasswordResetConfirm = () => {
|
||||
<div className='flex flex-col items-center'>
|
||||
<div className='w-full max-w-md'>
|
||||
<div className='flex items-center justify-center mb-6 gap-2'>
|
||||
<img src={logo} alt='Logo' className='h-10 rounded-full' />
|
||||
<img
|
||||
src={logo}
|
||||
alt={t('网站标志')}
|
||||
className='h-10 rounded-full'
|
||||
/>
|
||||
<Title heading={3} className='!text-gray-800'>
|
||||
{systemName}
|
||||
</Title>
|
||||
|
||||
@@ -118,7 +118,11 @@ const PasswordResetForm = () => {
|
||||
<div className='flex flex-col items-center'>
|
||||
<div className='w-full max-w-md'>
|
||||
<div className='flex items-center justify-center mb-6 gap-2'>
|
||||
<img src={logo} alt='Logo' className='h-10 rounded-full' />
|
||||
<img
|
||||
src={logo}
|
||||
alt={t('网站标志')}
|
||||
className='h-10 rounded-full'
|
||||
/>
|
||||
<Title heading={3} className='!text-gray-800'>
|
||||
{systemName}
|
||||
</Title>
|
||||
|
||||
@@ -580,7 +580,7 @@ const RegisterForm = () => {
|
||||
<Suspense
|
||||
fallback={
|
||||
<div className='flex justify-center my-2 h-10 items-center text-gray-400 text-xs'>
|
||||
Loading...
|
||||
{t('加载中...')}
|
||||
</div>
|
||||
}
|
||||
>
|
||||
|
||||
@@ -16,6 +16,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import { Trans } from 'react-i18next';
|
||||
import { API, showError, showSuccess } from '../../helpers';
|
||||
import { Button, Card, Divider, Form, Typography } from '@/components/ui';
|
||||
import React, { useState } from 'react';
|
||||
@@ -133,10 +134,16 @@ const TwoFAVerification = ({ onSuccess, onBack, isModal = false }) => {
|
||||
|
||||
<div className='bg-gray-50 dark:bg-gray-800 rounded-lg p-3'>
|
||||
<Text size='small' type='secondary'>
|
||||
<strong>{t('提示:')}</strong>
|
||||
<br />• {t('验证码每30秒更新一次')}
|
||||
<br />• {t('如果无法获取验证码,请使用备用码')}
|
||||
<br />• {t('每个备用码只能使用一次')}
|
||||
<Trans
|
||||
t={t}
|
||||
i18nKey='<part0>提示:</part0><part1/>• 验证码每30秒更新一次<part2/>• 如果无法获取验证码,请使用备用码<part3/>• 每个备用码只能使用一次'
|
||||
components={{
|
||||
part0: <strong />,
|
||||
part1: <br />,
|
||||
part2: <br />,
|
||||
part3: <br />,
|
||||
}}
|
||||
/>
|
||||
</Text>
|
||||
</div>
|
||||
</div>
|
||||
@@ -223,10 +230,16 @@ const TwoFAVerification = ({ onSuccess, onBack, isModal = false }) => {
|
||||
}}
|
||||
>
|
||||
<Text size='small' type='secondary'>
|
||||
<strong>{t('提示:')}</strong>
|
||||
<br />• {t('验证码每30秒更新一次')}
|
||||
<br />• {t('如果无法获取验证码,请使用备用码')}
|
||||
<br />• {t('每个备用码只能使用一次')}
|
||||
<Trans
|
||||
t={t}
|
||||
i18nKey='<part0>提示:</part0><part1/>• 验证码每30秒更新一次<part2/>• 如果无法获取验证码,请使用备用码<part3/>• 每个备用码只能使用一次'
|
||||
components={{
|
||||
part0: <strong />,
|
||||
part1: <br />,
|
||||
part2: <br />,
|
||||
part3: <br />,
|
||||
}}
|
||||
/>
|
||||
</Text>
|
||||
</div>
|
||||
</Card>
|
||||
|
||||
Reference in New Issue
Block a user