mirror of
https://github.com/langgenius/dify.git
synced 2026-05-03 07:46:31 +08:00
add i18n
This commit is contained in:
parent
019ef74bf2
commit
f1fe143962
@ -85,7 +85,7 @@ const Popup = () => {
|
|||||||
>
|
>
|
||||||
<div className='flex grow items-center'>
|
<div className='flex grow items-center'>
|
||||||
<RiPlayCircleLine className='mr-2 h-4 w-4' />
|
<RiPlayCircleLine className='mr-2 h-4 w-4' />
|
||||||
Go to add documents
|
{t('pipeline.common.goToAddDocuments')}
|
||||||
</div>
|
</div>
|
||||||
<RiArrowRightUpLine className='ml-2 h-4 w-4 shrink-0' />
|
<RiArrowRightUpLine className='ml-2 h-4 w-4 shrink-0' />
|
||||||
</Button>
|
</Button>
|
||||||
@ -95,7 +95,7 @@ const Popup = () => {
|
|||||||
>
|
>
|
||||||
<div className='flex grow items-center'>
|
<div className='flex grow items-center'>
|
||||||
<RiTerminalBoxLine className='mr-2 h-4 w-4' />
|
<RiTerminalBoxLine className='mr-2 h-4 w-4' />
|
||||||
Access API Reference
|
{t('workflow.common.accessAPIReference')}
|
||||||
</div>
|
</div>
|
||||||
<RiArrowRightUpLine className='ml-2 h-4 w-4 shrink-0' />
|
<RiArrowRightUpLine className='ml-2 h-4 w-4 shrink-0' />
|
||||||
</Button>
|
</Button>
|
||||||
@ -106,7 +106,7 @@ const Popup = () => {
|
|||||||
>
|
>
|
||||||
<div className='flex grow items-center'>
|
<div className='flex grow items-center'>
|
||||||
<RiHammerLine className='mr-2 h-4 w-4' />
|
<RiHammerLine className='mr-2 h-4 w-4' />
|
||||||
Publish as a Knowledge Pipeline
|
{t('pipeline.common.publishAs')}
|
||||||
</div>
|
</div>
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -4,7 +4,6 @@ import {
|
|||||||
useWorkflowStore,
|
useWorkflowStore,
|
||||||
} from '@/app/components/workflow/store'
|
} from '@/app/components/workflow/store'
|
||||||
import { useWorkflowConfig } from '@/service/use-workflow'
|
import { useWorkflowConfig } from '@/service/use-workflow'
|
||||||
import type { ToolWithProvider } from '@/app/components/workflow/types'
|
|
||||||
import type { FetchWorkflowDraftResponse } from '@/types/workflow'
|
import type { FetchWorkflowDraftResponse } from '@/types/workflow'
|
||||||
|
|
||||||
export const usePipelineConfig = () => {
|
export const usePipelineConfig = () => {
|
||||||
@ -21,16 +20,6 @@ export const usePipelineConfig = () => {
|
|||||||
handleUpdateWorkflowConfig,
|
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 handleUpdateNodesDefaultConfigs = useCallback((nodesDefaultConfigs: Record<string, any>) => {
|
||||||
const { setNodesDefaultConfigs } = workflowStore.getState()
|
const { setNodesDefaultConfigs } = workflowStore.getState()
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
import type { RAGPipelineVariables } from '@/models/pipeline'
|
import type { RAGPipelineVariables } from '@/models/pipeline'
|
||||||
import type { StateCreator } from 'zustand'
|
import type { StateCreator } from 'zustand'
|
||||||
import type { ToolWithProvider } from '../../workflow/types'
|
|
||||||
import { InputVarType } from '../../workflow/types'
|
import { InputVarType } from '../../workflow/types'
|
||||||
|
|
||||||
export type RagPipelineSliceShape = {
|
export type RagPipelineSliceShape = {
|
||||||
@ -11,8 +10,6 @@ export type RagPipelineSliceShape = {
|
|||||||
setNodesDefaultConfigs: (nodesDefaultConfigs: Record<string, any>) => void
|
setNodesDefaultConfigs: (nodesDefaultConfigs: Record<string, any>) => void
|
||||||
ragPipelineVariables: RAGPipelineVariables
|
ragPipelineVariables: RAGPipelineVariables
|
||||||
setRagPipelineVariables: (ragPipelineVariables: RAGPipelineVariables) => void
|
setRagPipelineVariables: (ragPipelineVariables: RAGPipelineVariables) => void
|
||||||
dataSourceList: ToolWithProvider[]
|
|
||||||
setDataSourceList: (dataSourceList: ToolWithProvider[]) => void
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export type CreateRagPipelineSliceSlice = StateCreator<RagPipelineSliceShape>
|
export type CreateRagPipelineSliceSlice = StateCreator<RagPipelineSliceShape>
|
||||||
@ -53,6 +50,4 @@ export const createRagPipelineSliceSlice: StateCreator<RagPipelineSliceShape> =
|
|||||||
}],
|
}],
|
||||||
}],
|
}],
|
||||||
setRagPipelineVariables: (ragPipelineVariables: RAGPipelineVariables) => set(() => ({ ragPipelineVariables })),
|
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 type { NodeSelectorProps } from './main'
|
||||||
import NodeSelector from './main'
|
import NodeSelector from './main'
|
||||||
import { useHooksStore } from '@/app/components/workflow/hooks-store/store'
|
import { useHooksStore } from '@/app/components/workflow/hooks-store/store'
|
||||||
import { BlockEnum } from '@/app/components/workflow/types'
|
import { BlockEnum } from '@/app/components/workflow/types'
|
||||||
import { useStore } from '@/app/components/workflow/store'
|
import { useStore } from '@/app/components/workflow/store'
|
||||||
|
import { useDataSourceList } from '@/service/use-pipeline'
|
||||||
|
|
||||||
const NodeSelectorWrapper = (props: NodeSelectorProps) => {
|
const NodeSelectorWrapper = (props: NodeSelectorProps) => {
|
||||||
const availableNodesMetaData = useHooksStore(s => s.availableNodesMetaData)
|
const availableNodesMetaData = useHooksStore(s => s.availableNodesMetaData)
|
||||||
@ -28,7 +31,8 @@ const NodeSelectorWrapper = (props: NodeSelectorProps) => {
|
|||||||
})
|
})
|
||||||
}, [availableNodesMetaData?.nodes])
|
}, [availableNodesMetaData?.nodes])
|
||||||
|
|
||||||
const dataSourceList = useStore(s => s.dataSourceList)
|
const pipelineId = useStore(s => s.pipelineId)
|
||||||
|
const { data: dataSourceList } = useDataSourceList(!pipelineId)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<NodeSelector
|
<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,
|
plugin: require(`./${lang}/plugin`).default,
|
||||||
pluginTags: require(`./${lang}/plugin-tags`).default,
|
pluginTags: require(`./${lang}/plugin-tags`).default,
|
||||||
time: require(`./${lang}/time`).default,
|
time: require(`./${lang}/time`).default,
|
||||||
|
pipeline: require(`./${lang}/pipeline`).default,
|
||||||
education: requireSilent(lang),
|
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,
|
UpdatePipelineInfoRequest,
|
||||||
UpdatePipelineInfoResponse,
|
UpdatePipelineInfoResponse,
|
||||||
} from '@/models/pipeline'
|
} from '@/models/pipeline'
|
||||||
|
import type { ToolWithProvider } from '@/app/components/workflow/types'
|
||||||
|
|
||||||
const NAME_SPACE = 'pipeline'
|
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…
Reference in New Issue
Block a user