diff --git a/web/app/education-apply/education-apply-page.tsx b/web/app/education-apply/education-apply-page.tsx index 5072e241ff..8d822f2ab0 100644 --- a/web/app/education-apply/education-apply-page.tsx +++ b/web/app/education-apply/education-apply-page.tsx @@ -1,6 +1,7 @@ 'use client' import { + useMemo, useState, } from 'react' import { useTranslation } from 'react-i18next' @@ -22,9 +23,11 @@ import { import { useProviderContext } from '@/context/provider-context' import { useToastContext } from '@/app/components/base/toast' import { EDUCATION_VERIFYING_LOCALSTORAGE_ITEM } from '@/app/education-apply/constants' +import { getLocaleOnClient } from '@/i18n' const EducationApplyAge = () => { const { t } = useTranslation() + const locale = getLocaleOnClient() const [schoolName, setSchoolName] = useState('') const [role, setRole] = useState('Student') const [ageChecked, setAgeChecked] = useState(false) @@ -39,6 +42,14 @@ const EducationApplyAge = () => { const { notify } = useToastContext() 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 = () => { setShowModal(undefined) onPlanInfoChanged() @@ -158,7 +169,7 @@ const EducationApplyAge = () => {
{t('education.learn')} diff --git a/web/app/education-apply/verify-state-modal.tsx b/web/app/education-apply/verify-state-modal.tsx index c20f05797b..aace6a3bb1 100644 --- a/web/app/education-apply/verify-state-modal.tsx +++ b/web/app/education-apply/verify-state-modal.tsx @@ -1,10 +1,11 @@ -import React, { useEffect, useRef, useState } from 'react' +import React, { useEffect, useMemo, useRef, useState } from 'react' import { createPortal } from 'react-dom' import { useTranslation } from 'react-i18next' import { RiExternalLinkLine, } from '@remixicon/react' import Button from '@/app/components/base/button' +import { getLocaleOnClient } from '@/i18n' export type IConfirm = { className?: string @@ -29,9 +30,22 @@ function Confirm({ email, }: IConfirm) { const { t } = useTranslation() + const locale = getLocaleOnClient() const dialogRef = useRef