Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
fix: move hardcoded text to language settings (#16990) (#17133)
Perfecto16c722d1d87c
diff --git a/api/core/rag/retrieval/dataset_retrieval.py b/api/core/rag/retrieval/dataset_retrieval.pyindex e00c989c9d7..244611c7509 100644--- a/api/core/rag/retrieval/dataset_retrieval.py+++ b/api/core/rag/retrieval/dataset_retrieval.py@@ -52,6 +52,7 @@ from core.rag.retrieval.template_prompts import (METADATA_FILTER_USER_PROMPT_2,METADATA_FILTER_USER_PROMPT_3,)+from core.tools.entities.common_entities import I18nObjectfrom core.tools.utils.dataset_retriever.dataset_retriever_base_tool import DatasetRetrieverBaseToolfrom extensions.ext_database import dbfrom libs.json_in_md_parser import parse_and_check_json_markdown@@ -294,7 +295,10 @@ class DatasetRetrieval:for dataset in available_datasets:description = dataset.descriptionif not description:- description = "useful for when you want to answer queries about the " + dataset.name+ description = I18nObject(+ en_US="useful for when you want to answer queries about the " + dataset.name,+ zh_Hans="用于回答关于 " + dataset.name + " 的查询",+ )description = description.replace("\n", "").replace("\r", "")message_tool = PromptMessageTool(diff --git a/api/core/tools/utils/dataset_retriever/dataset_retriever_tool.py b/api/core/tools/utils/dataset_retriever/dataset_retriever_tool.pyindex 63260cfac3a..fc3b61a191c 100644--- a/api/core/tools/utils/dataset_retriever/dataset_retriever_tool.py+++ b/api/core/tools/utils/dataset_retriever/dataset_retriever_tool.py@@ -6,6 +6,7 @@ from core.rag.datasource.retrieval_service import RetrievalServicefrom core.rag.entities.context_entities import DocumentContextfrom core.rag.models.document import Document as RetrievalDocumentfrom core.rag.retrieval.retrieval_methods import RetrievalMethod+from core.tools.entities.common_entities import I18nObjectfrom core.tools.utils.dataset_retriever.dataset_retriever_base_tool import DatasetRetrieverBaseToolfrom extensions.ext_database import dbfrom models.dataset import Dataset@@ -38,7 +39,10 @@ class DatasetRetrieverTool(DatasetRetrieverBaseTool):def from_dataset(cls, dataset: Dataset, **kwargs):description = dataset.descriptionif not description:- description = "useful for when you want to answer queries about the " + dataset.name+ description = I18nObject(+ en_US="useful for when you want to answer queries about the " + dataset.name,+ zh_Hans="用于回答关于 " + dataset.name + " 的查询",+ )description = description.replace("\n", "").replace("\r", "")return cls(diff --git a/api/services/dataset_service.py b/api/services/dataset_service.pyindex 61dc86a0284..68c193a6ba5 100644--- a/api/services/dataset_service.py+++ b/api/services/dataset_service.py@@ -21,6 +21,7 @@ from core.plugin.entities.plugin import ModelProviderIDfrom core.rag.index_processor.constant.built_in_field import BuiltInFieldfrom core.rag.index_processor.constant.index_type import IndexTypefrom core.rag.retrieval.retrieval_methods import RetrievalMethod+from core.tools.entities.common_entities import I18nObjectfrom events.dataset_event import dataset_was_deletedfrom events.document_event import document_was_deletedfrom extensions.ext_database import db@@ -1378,7 +1379,10 @@ class DocumentService:cut_length = 18cut_name = documents[0].name[:cut_length]dataset.name = cut_name + "..."- dataset.description = "useful for when you want to answer queries about the " + documents[0].name+ dataset.description = I18nObject(+ en_US="useful for when you want to answer queries about the " + documents[0].name,+ zh_Hans="用于回答关于 " + documents[0].name + " 的查询",+ )db.session.commit()return dataset, documents, batchdiff --git a/web/app/(commonLayout)/datasets/Container.tsx b/web/app/(commonLayout)/datasets/Container.tsxindex c1d9950bf36..95f8baea128 100644--- a/web/app/(commonLayout)/datasets/Container.tsx+++ b/web/app/(commonLayout)/datasets/Container.tsx@@ -38,6 +38,8 @@ const Container = () => {const { showExternalApiPanel, setShowExternalApiPanel } = useExternalApiPanel()const [includeAll, { toggle: toggleIncludeAll }] = useBoolean(false)+ document.title = `${t('dataset.knowledge')} - Dify`+const options = useMemo(() => {return [{ value: 'dataset', text: t('dataset.datasets') },diff --git a/web/app/(commonLayout)/datasets/page.tsx b/web/app/(commonLayout)/datasets/page.tsxindex 096a1b89792..678de47c943 100644--- a/web/app/(commonLayout)/datasets/page.tsx+++ b/web/app/(commonLayout)/datasets/page.tsx@@ -4,8 +4,4 @@ const AppList = async () => {return <Container />}-export const metadata = {- title: 'Datasets - Dify',-}-export default AppListdiff --git a/web/app/(commonLayout)/plugins/page.tsx b/web/app/(commonLayout)/plugins/page.tsxindex a3066311b2b..cc525992fae 100644--- a/web/app/(commonLayout)/plugins/page.tsx+++ b/web/app/(commonLayout)/plugins/page.tsx@@ -13,8 +13,4 @@ const PluginList = async () => {)}-export const metadata = {- title: 'Plugins - Dify',-}-export default PluginListdiff --git a/web/app/components/base/app-icon-picker/ImageInput.tsx b/web/app/components/base/app-icon-picker/ImageInput.tsxindex a973362ec8e..9c0a95c021d 100644--- a/web/app/components/base/app-icon-picker/ImageInput.tsx+++ b/web/app/components/base/app-icon-picker/ImageInput.tsx@@ -4,6 +4,7 @@ import type { ChangeEvent, FC } from 'react'import { createRef, useEffect, useState } from 'react'import Cropper, { type Area, type CropperProps } from 'react-easy-crop'import classNames from 'classnames'+import { useTranslation } from 'react-i18next'import { ImagePlus } from '../icons/src/vender/line/images'import { useDraggableUploader } from './hooks'@@ -26,6 +27,7 @@ const ImageInput: FC<UploaderProps> = ({cropShape,onImageInput,}) => {+ const { t } = useTranslation()const [inputImage, setInputImage] = useState<{ file: File; url: string }>()const [isAnimatedImage, setIsAnimatedImage] = useState<boolean>(false)useEffect(() => {@@ -103,8 +105,8 @@ const ImageInput: FC<UploaderProps> = ({? <><ImagePlus className="pointer-events-none mb-3 h-[30px] w-[30px]" /><div className="mb-[2px] text-sm font-medium">- <span className="pointer-events-none">Drop your image here, or </span>- <button className="text-components-button-primary-bg" onClick={() => inputRef.current?.click()}>browse</button>+ <span className="pointer-events-none">{t('common.imageInput.dropImageHere')} </span>+ <button className="text-components-button-primary-bg" onClick={() => inputRef.current?.click()}>{t('common.imageInput.browse')}</button><inputref={inputRef} type="file" className="hidden"onClick={e => ((e.target as HTMLInputElement).value = '')}@@ -112,7 +114,7 @@ const ImageInput: FC<UploaderProps> = ({onChange={handleLocalFileInput}/></div>- <div className="pointer-events-none text-xs">Supports PNG, JPG, JPEG, WEBP and GIF</div>+ <div className="pointer-events-none">{t('common.imageInput.supportedFormats')}</div></>: handleShowImage()}diff --git a/web/app/components/plugins/plugin-page/index.tsx b/web/app/components/plugins/plugin-page/index.tsxindex 74991938a23..eb28e176550 100644--- a/web/app/components/plugins/plugin-page/index.tsx+++ b/web/app/components/plugins/plugin-page/index.tsx@@ -56,6 +56,8 @@ const PluginPage = ({const searchParams = useSearchParams()const { replace } = useRouter()+ document.title = `${t('plugin.metadata.title')} - Dify`+// just support install one package nowconst packageId = useMemo(() => {const idStrings = searchParams.get(PACKAGE_IDS_KEY)diff --git a/web/i18n/en-US/common.ts b/web/i18n/en-US/common.tsindex 62e1d166bac..a0f2eebc8e1 100644--- a/web/i18n/en-US/common.ts+++ b/web/i18n/en-US/common.ts@@ -649,6 +649,11 @@ const translation = {pagination: {perPage: 'Items per page',},+ imageInput: {+ dropImageHere: 'Drop your image here, or',+ browse: 'browse',+ supportedFormats: 'Supports PNG, JPG, JPEG, WEBP and GIF',+ },}export default translationdiff --git a/web/i18n/en-US/plugin.ts b/web/i18n/en-US/plugin.tsindex bdfcfb3e72d..fd1a8c2a059 100644--- a/web/i18n/en-US/plugin.ts+++ b/web/i18n/en-US/plugin.ts@@ -1,4 +1,7 @@const translation = {+ metadata: {+ title: 'Plugins',+ },category: {all: 'All',models: 'Models',diff --git a/web/i18n/zh-Hans/common.ts b/web/i18n/zh-Hans/common.tsindex 7ece3acf54b..ef865263bc4 100644--- a/web/i18n/zh-Hans/common.ts+++ b/web/i18n/zh-Hans/common.ts@@ -649,6 +649,11 @@ const translation = {pagination: {perPage: '每页显示',},+ imageInput: {+ dropImageHere: '将图片拖放到此处,或',+ browse: '浏览',+ supportedFormats: '支持PNG、JPG、JPEG、WEBP和GIF格式',+ },}export default translationdiff --git a/web/i18n/zh-Hans/plugin.ts b/web/i18n/zh-Hans/plugin.tsindex dfd13c6bf06..94b81ef1d5e 100644--- a/web/i18n/zh-Hans/plugin.ts+++ b/web/i18n/zh-Hans/plugin.ts@@ -1,4 +1,7 @@const translation = {+ metadata: {+ title: '插件',+ },category: {all: '全部',models: '模型',