Fix/language support (#2154)

This commit is contained in:
crazywoola
2024-01-24 11:08:11 +08:00
committed by GitHub
parent 00f4e6ec44
commit e58c3ac374
28 changed files with 103 additions and 71 deletions

View File

@@ -8,11 +8,11 @@ import Link from 'next/link'
import { useContext } from 'use-context-selector'
import Toast from '../components/base/toast'
import style from './page.module.css'
// import Tooltip from '@/app/components/base/tooltip/index'
import { IS_CE_EDITION, apiPrefix } from '@/config'
import Button from '@/app/components/base/button'
import { login, oauth } from '@/service/common'
import I18n from '@/context/i18n'
import { LanguagesSupportedUnderscore, getModelRuntimeSupported } from '@/utils/language'
const validEmailReg = /^[\w\.-]+@([\w-]+\.)+[\w-]{2,}$/
@@ -67,6 +67,7 @@ const NormalForm = () => {
const { t } = useTranslation()
const router = useRouter()
const { locale } = useContext(I18n)
const language = getModelRuntimeSupported(locale)
const [state, dispatch] = useReducer(reducer, {
formValid: false,
@@ -282,13 +283,13 @@ const NormalForm = () => {
<Link
className='text-primary-600'
target={'_blank'}
href={locale === 'en' ? 'https://docs.dify.ai/user-agreement/terms-of-service' : 'https://docs.dify.ai/v/zh-hans/user-agreement/terms-of-service'}
href={language !== LanguagesSupportedUnderscore[1] ? 'https://docs.dify.ai/user-agreement/terms-of-service' : 'https://docs.dify.ai/v/zh-hans/user-agreement/terms-of-service'}
>{t('login.tos')}</Link>
&nbsp;&&nbsp;
<Link
className='text-primary-600'
target={'_blank'}
href={locale === 'en' ? 'https://docs.dify.ai/user-agreement/privacy-policy' : 'https://docs.dify.ai/v/zh-hans/user-agreement/privacy-policy'}
href={language !== LanguagesSupportedUnderscore[1] ? 'https://docs.dify.ai/user-agreement/privacy-policy' : 'https://docs.dify.ai/v/zh-hans/user-agreement/privacy-policy'}
>{t('login.pp')}</Link>
</div>