dify/web/app/components/workflow/nodes/knowledge-base/hooks/use-settings-display.ts
Stephen Zhou 6d0e36479b
refactor(i18n): use JSON with flattened key and namespace (#30114)
Co-authored-by: yyh <yuanyouhuilyz@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-12-29 14:52:32 +08:00

19 lines
788 B
TypeScript

import { useTranslation } from 'react-i18next'
import {
IndexMethodEnum,
RetrievalSearchMethodEnum,
} from '../types'
export const useSettingsDisplay = () => {
const { t } = useTranslation()
return {
[IndexMethodEnum.QUALIFIED]: t('stepTwo.qualified', { ns: 'datasetCreation' }),
[IndexMethodEnum.ECONOMICAL]: t('form.indexMethodEconomy', { ns: 'datasetSettings' }),
[RetrievalSearchMethodEnum.semantic]: t('retrieval.semantic_search.title', { ns: 'dataset' }),
[RetrievalSearchMethodEnum.fullText]: t('retrieval.full_text_search.title', { ns: 'dataset' }),
[RetrievalSearchMethodEnum.hybrid]: t('retrieval.hybrid_search.title', { ns: 'dataset' }),
[RetrievalSearchMethodEnum.keywordSearch]: t('retrieval.keyword_search.title', { ns: 'dataset' }),
}
}