Feat/i18n restructure (#2529)

This commit is contained in:
crazywoola
2024-02-23 14:31:06 +08:00
committed by GitHub
parent 91ea6fe4ee
commit 9574730050
140 changed files with 448 additions and 659 deletions

View File

@@ -42,7 +42,7 @@ import useBreakpoints, { MediaType } from '@/hooks/use-breakpoints'
import Tooltip from '@/app/components/base/tooltip'
import TooltipPlus from '@/app/components/base/tooltip-plus'
import { useModelListAndDefaultModelAndCurrentProviderAndModel } from '@/app/components/header/account-setting/model-provider-page/hooks'
import { LanguagesSupportedUnderscore, getModelRuntimeSupported } from '@/utils/language'
import { LanguagesSupported } from '@/i18n/language'
type ValueOf<T> = T[keyof T]
type StepTwoProps = {
@@ -89,7 +89,6 @@ const StepTwo = ({
}: StepTwoProps) => {
const { t } = useTranslation()
const { locale } = useContext(I18n)
const language = getModelRuntimeSupported(locale)
const media = useBreakpoints()
const isMobile = media === MediaType.mobile
@@ -114,7 +113,7 @@ const StepTwo = ({
const [docForm, setDocForm] = useState<DocForm | string>(
(datasetId && documentDetail) ? documentDetail.doc_form : DocForm.TEXT,
)
const [docLanguage, setDocLanguage] = useState<string>(language !== LanguagesSupportedUnderscore[1] ? 'English' : 'Chinese')
const [docLanguage, setDocLanguage] = useState<string>(locale !== LanguagesSupported[1] ? 'English' : 'Chinese')
const [QATipHide, setQATipHide] = useState(false)
const [previewSwitched, setPreviewSwitched] = useState(false)
const [showPreview, { setTrue: setShowPreview, setFalse: hidePreview }] = useBoolean()