|
@@ -1,6 +1,7 @@
|
|
'use client'
|
|
'use client'
|
|
|
|
|
|
import {
|
|
import {
|
|
|
|
+ useMemo,
|
|
useState,
|
|
useState,
|
|
} from 'react'
|
|
} from 'react'
|
|
import { useTranslation } from 'react-i18next'
|
|
import { useTranslation } from 'react-i18next'
|
|
@@ -22,9 +23,11 @@ import {
|
|
import { useProviderContext } from '@/context/provider-context'
|
|
import { useProviderContext } from '@/context/provider-context'
|
|
import { useToastContext } from '@/app/components/base/toast'
|
|
import { useToastContext } from '@/app/components/base/toast'
|
|
import { EDUCATION_VERIFYING_LOCALSTORAGE_ITEM } from '@/app/education-apply/constants'
|
|
import { EDUCATION_VERIFYING_LOCALSTORAGE_ITEM } from '@/app/education-apply/constants'
|
|
|
|
+import { getLocaleOnClient } from '@/i18n'
|
|
|
|
|
|
const EducationApplyAge = () => {
|
|
const EducationApplyAge = () => {
|
|
const { t } = useTranslation()
|
|
const { t } = useTranslation()
|
|
|
|
+ const locale = getLocaleOnClient()
|
|
const [schoolName, setSchoolName] = useState('')
|
|
const [schoolName, setSchoolName] = useState('')
|
|
const [role, setRole] = useState('Student')
|
|
const [role, setRole] = useState('Student')
|
|
const [ageChecked, setAgeChecked] = useState(false)
|
|
const [ageChecked, setAgeChecked] = useState(false)
|
|
@@ -39,6 +42,14 @@ const EducationApplyAge = () => {
|
|
const { notify } = useToastContext()
|
|
const { notify } = useToastContext()
|
|
const router = useRouter()
|
|
const router = useRouter()
|
|
|
|
|
|
|
|
+ const docLink = useMemo(() => {
|
|
|
|
+ if (locale === 'zh-Hans')
|
|
|
|
+ return 'https://docs.dify.ai/zh-hans/getting-started/dify-for-education'
|
|
|
|
+ if (locale === 'ja-JP')
|
|
|
|
+ return 'https://docs.dify.ai/ja-jp/getting-started/dify-for-education'
|
|
|
|
+ return 'https://docs.dify.ai/getting-started/dify-for-education'
|
|
|
|
+ }, [locale])
|
|
|
|
+
|
|
const handleModalConfirm = () => {
|
|
const handleModalConfirm = () => {
|
|
setShowModal(undefined)
|
|
setShowModal(undefined)
|
|
onPlanInfoChanged()
|
|
onPlanInfoChanged()
|
|
@@ -158,7 +169,7 @@ const EducationApplyAge = () => {
|
|
<div className='mb-4 mt-5 h-[1px] bg-gradient-to-r from-[rgba(16,24,40,0.08)]'></div>
|
|
<div className='mb-4 mt-5 h-[1px] bg-gradient-to-r from-[rgba(16,24,40,0.08)]'></div>
|
|
<a
|
|
<a
|
|
className='system-xs-regular flex items-center text-text-accent'
|
|
className='system-xs-regular flex items-center text-text-accent'
|
|
- href='https://docs.dify.ai/getting-started/dify-for-education'
|
|
|
|
|
|
+ href={docLink}
|
|
target='_blank'
|
|
target='_blank'
|
|
>
|
|
>
|
|
{t('education.learn')}
|
|
{t('education.learn')}
|