Feat/i18n restructure (#2529)
This commit is contained in:
parent
91ea6fe4ee
commit
9574730050
140 changed files with 448 additions and 659 deletions
|
|
@ -9,7 +9,7 @@ import { useContext } from 'use-context-selector'
|
|||
import { Download02 as DownloadIcon } from '@/app/components/base/icons/src/vender/solid/general'
|
||||
import { DocForm } from '@/models/datasets'
|
||||
import I18n from '@/context/i18n'
|
||||
import { LanguagesSupportedUnderscore, getModelRuntimeSupported } from '@/utils/language'
|
||||
import { LanguagesSupported } from '@/i18n/language'
|
||||
|
||||
const CSV_TEMPLATE_QA_EN = [
|
||||
['question', 'answer'],
|
||||
|
|
@ -35,11 +35,10 @@ const CSV_TEMPLATE_CN = [
|
|||
const CSVDownload: FC<{ docForm: DocForm }> = ({ docForm }) => {
|
||||
const { t } = useTranslation()
|
||||
const { locale } = useContext(I18n)
|
||||
const language = getModelRuntimeSupported(locale)
|
||||
const { CSVDownloader, Type } = useCSVDownloader()
|
||||
|
||||
const getTemplate = () => {
|
||||
if (language === LanguagesSupportedUnderscore[1]) {
|
||||
if (locale === LanguagesSupported[1]) {
|
||||
if (docForm === DocForm.QA)
|
||||
return CSV_TEMPLATE_QA_CN
|
||||
return CSV_TEMPLATE_CN
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue