mirror of
https://github.com/langgenius/dify.git
synced 2025-12-28 10:32:31 +00:00
add i18n
This commit is contained in:
parent
019ef74bf2
commit
f1fe143962
@ -85,7 +85,7 @@ const Popup = () => {
|
||||
>
|
||||
<div className='flex grow items-center'>
|
||||
<RiPlayCircleLine className='mr-2 h-4 w-4' />
|
||||
Go to add documents
|
||||
{t('pipeline.common.goToAddDocuments')}
|
||||
</div>
|
||||
<RiArrowRightUpLine className='ml-2 h-4 w-4 shrink-0' />
|
||||
</Button>
|
||||
@ -95,7 +95,7 @@ const Popup = () => {
|
||||
>
|
||||
<div className='flex grow items-center'>
|
||||
<RiTerminalBoxLine className='mr-2 h-4 w-4' />
|
||||
Access API Reference
|
||||
{t('workflow.common.accessAPIReference')}
|
||||
</div>
|
||||
<RiArrowRightUpLine className='ml-2 h-4 w-4 shrink-0' />
|
||||
</Button>
|
||||
@ -106,7 +106,7 @@ const Popup = () => {
|
||||
>
|
||||
<div className='flex grow items-center'>
|
||||
<RiHammerLine className='mr-2 h-4 w-4' />
|
||||
Publish as a Knowledge Pipeline
|
||||
{t('pipeline.common.publishAs')}
|
||||
</div>
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
@ -4,7 +4,6 @@ import {
|
||||
useWorkflowStore,
|
||||
} from '@/app/components/workflow/store'
|
||||
import { useWorkflowConfig } from '@/service/use-workflow'
|
||||
import type { ToolWithProvider } from '@/app/components/workflow/types'
|
||||
import type { FetchWorkflowDraftResponse } from '@/types/workflow'
|
||||
|
||||
export const usePipelineConfig = () => {
|
||||
@ -21,16 +20,6 @@ export const usePipelineConfig = () => {
|
||||
handleUpdateWorkflowConfig,
|
||||
)
|
||||
|
||||
const handleUpdateDataSourceList = useCallback((dataSourceList: ToolWithProvider[]) => {
|
||||
const { setDataSourceList } = workflowStore.getState()
|
||||
|
||||
setDataSourceList!(dataSourceList)
|
||||
}, [workflowStore])
|
||||
useWorkflowConfig<ToolWithProvider[]>(
|
||||
'/rag/pipelines/datasource-plugins',
|
||||
handleUpdateDataSourceList,
|
||||
)
|
||||
|
||||
const handleUpdateNodesDefaultConfigs = useCallback((nodesDefaultConfigs: Record<string, any>) => {
|
||||
const { setNodesDefaultConfigs } = workflowStore.getState()
|
||||
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
import type { RAGPipelineVariables } from '@/models/pipeline'
|
||||
import type { StateCreator } from 'zustand'
|
||||
import type { ToolWithProvider } from '../../workflow/types'
|
||||
import { InputVarType } from '../../workflow/types'
|
||||
|
||||
export type RagPipelineSliceShape = {
|
||||
@ -11,8 +10,6 @@ export type RagPipelineSliceShape = {
|
||||
setNodesDefaultConfigs: (nodesDefaultConfigs: Record<string, any>) => void
|
||||
ragPipelineVariables: RAGPipelineVariables
|
||||
setRagPipelineVariables: (ragPipelineVariables: RAGPipelineVariables) => void
|
||||
dataSourceList: ToolWithProvider[]
|
||||
setDataSourceList: (dataSourceList: ToolWithProvider[]) => void
|
||||
}
|
||||
|
||||
export type CreateRagPipelineSliceSlice = StateCreator<RagPipelineSliceShape>
|
||||
@ -53,6 +50,4 @@ export const createRagPipelineSliceSlice: StateCreator<RagPipelineSliceShape> =
|
||||
}],
|
||||
}],
|
||||
setRagPipelineVariables: (ragPipelineVariables: RAGPipelineVariables) => set(() => ({ ragPipelineVariables })),
|
||||
dataSourceList: [],
|
||||
setDataSourceList: (dataSourceList: ToolWithProvider[]) => set(() => ({ dataSourceList })),
|
||||
})
|
||||
|
||||
@ -1,9 +1,12 @@
|
||||
import { useMemo } from 'react'
|
||||
import {
|
||||
useMemo,
|
||||
} from 'react'
|
||||
import type { NodeSelectorProps } from './main'
|
||||
import NodeSelector from './main'
|
||||
import { useHooksStore } from '@/app/components/workflow/hooks-store/store'
|
||||
import { BlockEnum } from '@/app/components/workflow/types'
|
||||
import { useStore } from '@/app/components/workflow/store'
|
||||
import { useDataSourceList } from '@/service/use-pipeline'
|
||||
|
||||
const NodeSelectorWrapper = (props: NodeSelectorProps) => {
|
||||
const availableNodesMetaData = useHooksStore(s => s.availableNodesMetaData)
|
||||
@ -28,7 +31,8 @@ const NodeSelectorWrapper = (props: NodeSelectorProps) => {
|
||||
})
|
||||
}, [availableNodesMetaData?.nodes])
|
||||
|
||||
const dataSourceList = useStore(s => s.dataSourceList)
|
||||
const pipelineId = useStore(s => s.pipelineId)
|
||||
const { data: dataSourceList } = useDataSourceList(!pipelineId)
|
||||
|
||||
return (
|
||||
<NodeSelector
|
||||
|
||||
4
web/i18n/de-DE/pipeline.ts
Normal file
4
web/i18n/de-DE/pipeline.ts
Normal file
@ -0,0 +1,4 @@
|
||||
const translation = {
|
||||
}
|
||||
|
||||
export default translation
|
||||
8
web/i18n/en-US/pipeline.ts
Normal file
8
web/i18n/en-US/pipeline.ts
Normal file
@ -0,0 +1,8 @@
|
||||
const translation = {
|
||||
common: {
|
||||
goToAddDocuments: 'Go to add documents',
|
||||
publishAs: 'Publish as a Knowledge Pipeline',
|
||||
},
|
||||
}
|
||||
|
||||
export default translation
|
||||
4
web/i18n/es-ES/pipeline.ts
Normal file
4
web/i18n/es-ES/pipeline.ts
Normal file
@ -0,0 +1,4 @@
|
||||
const translation = {
|
||||
}
|
||||
|
||||
export default translation
|
||||
4
web/i18n/fa-IR/pipeline.ts
Normal file
4
web/i18n/fa-IR/pipeline.ts
Normal file
@ -0,0 +1,4 @@
|
||||
const translation = {
|
||||
}
|
||||
|
||||
export default translation
|
||||
4
web/i18n/fr-FR/pipeline.ts
Normal file
4
web/i18n/fr-FR/pipeline.ts
Normal file
@ -0,0 +1,4 @@
|
||||
const translation = {
|
||||
}
|
||||
|
||||
export default translation
|
||||
4
web/i18n/hi-IN/pipeline.ts
Normal file
4
web/i18n/hi-IN/pipeline.ts
Normal file
@ -0,0 +1,4 @@
|
||||
const translation = {
|
||||
}
|
||||
|
||||
export default translation
|
||||
@ -44,6 +44,7 @@ const loadLangResources = (lang: string) => ({
|
||||
plugin: require(`./${lang}/plugin`).default,
|
||||
pluginTags: require(`./${lang}/plugin-tags`).default,
|
||||
time: require(`./${lang}/time`).default,
|
||||
pipeline: require(`./${lang}/pipeline`).default,
|
||||
education: requireSilent(lang),
|
||||
},
|
||||
})
|
||||
|
||||
4
web/i18n/it-IT/pipeline.ts
Normal file
4
web/i18n/it-IT/pipeline.ts
Normal file
@ -0,0 +1,4 @@
|
||||
const translation = {
|
||||
}
|
||||
|
||||
export default translation
|
||||
4
web/i18n/ja-JP/pipeline.ts
Normal file
4
web/i18n/ja-JP/pipeline.ts
Normal file
@ -0,0 +1,4 @@
|
||||
const translation = {
|
||||
}
|
||||
|
||||
export default translation
|
||||
4
web/i18n/ko-KR/pipeline.ts
Normal file
4
web/i18n/ko-KR/pipeline.ts
Normal file
@ -0,0 +1,4 @@
|
||||
const translation = {
|
||||
}
|
||||
|
||||
export default translation
|
||||
4
web/i18n/pl-PL/pipeline.ts
Normal file
4
web/i18n/pl-PL/pipeline.ts
Normal file
@ -0,0 +1,4 @@
|
||||
const translation = {
|
||||
}
|
||||
|
||||
export default translation
|
||||
4
web/i18n/pt-BR/pipeline.ts
Normal file
4
web/i18n/pt-BR/pipeline.ts
Normal file
@ -0,0 +1,4 @@
|
||||
const translation = {
|
||||
}
|
||||
|
||||
export default translation
|
||||
4
web/i18n/ro-RO/pipeline.ts
Normal file
4
web/i18n/ro-RO/pipeline.ts
Normal file
@ -0,0 +1,4 @@
|
||||
const translation = {
|
||||
}
|
||||
|
||||
export default translation
|
||||
4
web/i18n/ru-RU/pipeline.ts
Normal file
4
web/i18n/ru-RU/pipeline.ts
Normal file
@ -0,0 +1,4 @@
|
||||
const translation = {
|
||||
}
|
||||
|
||||
export default translation
|
||||
4
web/i18n/sl-SI/pipeline.ts
Normal file
4
web/i18n/sl-SI/pipeline.ts
Normal file
@ -0,0 +1,4 @@
|
||||
const translation = {
|
||||
}
|
||||
|
||||
export default translation
|
||||
4
web/i18n/th-TH/pipeline.ts
Normal file
4
web/i18n/th-TH/pipeline.ts
Normal file
@ -0,0 +1,4 @@
|
||||
const translation = {
|
||||
}
|
||||
|
||||
export default translation
|
||||
4
web/i18n/tr-TR/pipeline.ts
Normal file
4
web/i18n/tr-TR/pipeline.ts
Normal file
@ -0,0 +1,4 @@
|
||||
const translation = {
|
||||
}
|
||||
|
||||
export default translation
|
||||
4
web/i18n/uk-UA/pipeline.ts
Normal file
4
web/i18n/uk-UA/pipeline.ts
Normal file
@ -0,0 +1,4 @@
|
||||
const translation = {
|
||||
}
|
||||
|
||||
export default translation
|
||||
4
web/i18n/vi-VN/pipeline.ts
Normal file
4
web/i18n/vi-VN/pipeline.ts
Normal file
@ -0,0 +1,4 @@
|
||||
const translation = {
|
||||
}
|
||||
|
||||
export default translation
|
||||
8
web/i18n/zh-Hans/pipeline.ts
Normal file
8
web/i18n/zh-Hans/pipeline.ts
Normal file
@ -0,0 +1,8 @@
|
||||
const translation = {
|
||||
common: {
|
||||
goToAddDocuments: '去添加文档',
|
||||
publishAs: '发布为知识管道',
|
||||
},
|
||||
}
|
||||
|
||||
export default translation
|
||||
4
web/i18n/zh-Hant/pipeline.ts
Normal file
4
web/i18n/zh-Hant/pipeline.ts
Normal file
@ -0,0 +1,4 @@
|
||||
const translation = {
|
||||
}
|
||||
|
||||
export default translation
|
||||
@ -16,6 +16,7 @@ import type {
|
||||
UpdatePipelineInfoRequest,
|
||||
UpdatePipelineInfoResponse,
|
||||
} from '@/models/pipeline'
|
||||
import type { ToolWithProvider } from '@/app/components/workflow/types'
|
||||
|
||||
const NAME_SPACE = 'pipeline'
|
||||
|
||||
@ -126,3 +127,14 @@ export const usePipelineProcessingParams = (pipelineId: string) => {
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
export const useDataSourceList = (enabled?: boolean) => {
|
||||
return useQuery<ToolWithProvider[]>({
|
||||
enabled,
|
||||
queryKey: [NAME_SPACE, 'data-source'],
|
||||
queryFn: () => {
|
||||
return get('/rag/pipelines/datasource-plugins')
|
||||
},
|
||||
retry: false,
|
||||
})
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user