mirror of
https://github.com/labring/FastGPT.git
synced 2025-08-02 20:58:12 +00:00
I18n Translations (#2267)
* rebase * i18n-1 * add error info i18n * fix * fix * refactor: 删除error.json * delete useI18n
This commit is contained in:
@@ -4,7 +4,7 @@ import { UserAuthTypeEnum } from '@fastgpt/global/support/user/auth/constants';
|
||||
import { useTranslation } from 'next-i18next';
|
||||
import { useSystemStore } from '@/web/common/system/useSystemStore';
|
||||
import { useRequest2 } from '@fastgpt/web/hooks/useRequest';
|
||||
|
||||
import { i18nT } from '@fastgpt/web/i18n/utils';
|
||||
let timer: NodeJS.Timeout;
|
||||
|
||||
export const useSendCode = () => {
|
||||
@@ -29,8 +29,8 @@ export const useSendCode = () => {
|
||||
}, 1000);
|
||||
},
|
||||
{
|
||||
successToast: '验证码已发送',
|
||||
errorToast: '验证码发送异常',
|
||||
successToast: i18nT('user:password.code_sended'),
|
||||
errorToast: i18nT('user:password.code_send_error'),
|
||||
refreshDeps: [codeCountDown, feConfigs?.googleClientVerKey]
|
||||
}
|
||||
);
|
||||
@@ -38,12 +38,12 @@ export const useSendCode = () => {
|
||||
const sendCodeText = useMemo(() => {
|
||||
if (codeSending) return t('common:support.user.auth.Sending Code');
|
||||
if (codeCountDown >= 10) {
|
||||
return `${codeCountDown}s后重新获取`;
|
||||
return `${codeCountDown}${t('user:password.get_code_again')}`;
|
||||
}
|
||||
if (codeCountDown > 0) {
|
||||
return `0${codeCountDown}s后重新获取`;
|
||||
return `0${codeCountDown}${t('user:password.get_code_again')}`;
|
||||
}
|
||||
return '获取验证码';
|
||||
return t('user:password.get_code');
|
||||
}, [codeCountDown, codeSending, t]);
|
||||
|
||||
return {
|
||||
|
Reference in New Issue
Block a user