Skip to content

armgit / dify

Public Imported from GitHub
0

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.

fix: missing i18n translation for Trans (#30353)

Stephen Zhou3505516e8e32
diff --git a/web/app/account/(commonLayout)/account-page/email-change-modal.tsx b/web/app/account/(commonLayout)/account-page/email-change-modal.tsx
index 6e702770f73..e74ca9ed414 100644
--- a/web/app/account/(commonLayout)/account-page/email-change-modal.tsx
+++ b/web/app/account/(commonLayout)/account-page/email-change-modal.tsx
@@ -214,7 +214,8 @@ const EmailChangeModal = ({ onClose, email, show }: Props) => {
<div className="body-md-medium text-text-warning">{t('account.changeEmail.authTip', { ns: 'common' })}</div>
<div className="body-md-regular text-text-secondary">
<Trans
- i18nKey="common.account.changeEmail.content1"
+ i18nKey="account.changeEmail.content1"
+ ns="common"
components={{ email: <span className="body-md-medium text-text-primary"></span> }}
values={{ email }}
/>
@@ -244,7 +245,8 @@ const EmailChangeModal = ({ onClose, email, show }: Props) => {
<div className="space-y-0.5 pb-2 pt-1">
<div className="body-md-regular text-text-secondary">
<Trans
- i18nKey="common.account.changeEmail.content2"
+ i18nKey="account.changeEmail.content2"
+ ns="common"
components={{ email: <span className="body-md-medium text-text-primary"></span> }}
values={{ email }}
/>
@@ -333,7 +335,8 @@ const EmailChangeModal = ({ onClose, email, show }: Props) => {
<div className="space-y-0.5 pb-2 pt-1">
<div className="body-md-regular text-text-secondary">
<Trans
- i18nKey="common.account.changeEmail.content4"
+ i18nKey="account.changeEmail.content4"
+ ns="common"
components={{ email: <span className="body-md-medium text-text-primary"></span> }}
values={{ email: mail }}
/>
diff --git a/web/app/components/app/log/empty-element.tsx b/web/app/components/app/log/empty-element.tsx
index d433c7fd72e..e42a1df7d53 100644
--- a/web/app/components/app/log/empty-element.tsx
+++ b/web/app/components/app/log/empty-element.tsx
@@ -34,7 +34,8 @@ const EmptyElement: FC<{ appDetail: App }> = ({ appDetail }) => {
</span>
<div className="system-sm-regular mt-2 text-text-tertiary">
<Trans
- i18nKey="appLog.table.empty.element.content"
+ i18nKey="table.empty.element.content"
+ ns="appLog"
components={{
shareLink: <Link href={`${appDetail.site.app_base_url}${basePath}/${getWebAppType(appDetail.mode)}/${appDetail.site.access_token}`} className="text-util-colors-blue-blue-600" target="_blank" rel="noopener noreferrer" />,
testLink: <Link href={getRedirectionPath(true, appDetail)} className="text-util-colors-blue-blue-600" />,
diff --git a/web/app/components/app/overview/settings/index.tsx b/web/app/components/app/overview/settings/index.tsx
index 0117510890e..428a475da98 100644
--- a/web/app/components/app/overview/settings/index.tsx
+++ b/web/app/components/app/overview/settings/index.tsx
@@ -413,6 +413,7 @@ const SettingsModal: FC<ISettingsModalProps> = ({
<p className={cn('body-xs-regular pb-0.5 text-text-tertiary')}>
<Trans
i18nKey={`${prefixSettings}.more.privacyPolicyTip`}
+ ns="appOverview"
components={{ privacyPolicyLink: <Link href="https://dify.ai/privacy" target="_blank" rel="noopener noreferrer" className="text-text-accent" /> }}
/>
</p>
diff --git a/web/app/components/header/account-setting/members-page/transfer-ownership-modal/index.tsx b/web/app/components/header/account-setting/members-page/transfer-ownership-modal/index.tsx
index 80dc91702b7..1d54167458c 100644
--- a/web/app/components/header/account-setting/members-page/transfer-ownership-modal/index.tsx
+++ b/web/app/components/header/account-setting/members-page/transfer-ownership-modal/index.tsx
@@ -140,7 +140,8 @@ const TransferOwnershipModal = ({ onClose, show }: Props) => {
<div className="body-md-regular text-text-secondary">{t('members.transferModal.warningTip', { ns: 'common' })}</div>
<div className="body-md-regular text-text-secondary">
<Trans
- i18nKey="common.members.transferModal.sendTip"
+ i18nKey="members.transferModal.sendTip"
+ ns="common"
components={{ email: <span className="body-md-medium text-text-primary"></span> }}
values={{ email: userProfile.email }}
/>
@@ -170,7 +171,8 @@ const TransferOwnershipModal = ({ onClose, show }: Props) => {
<div className="pb-2 pt-1">
<div className="body-md-regular text-text-secondary">
<Trans
- i18nKey="common.members.transferModal.verifyContent"
+ i18nKey="members.transferModal.verifyContent"
+ ns="common"
components={{ email: <span className="body-md-medium text-text-primary"></span> }}
values={{ email: userProfile.email }}
/>
diff --git a/web/app/components/plugins/base/deprecation-notice.tsx b/web/app/components/plugins/base/deprecation-notice.tsx
index ef59dc36457..7e321330457 100644
--- a/web/app/components/plugins/base/deprecation-notice.tsx
+++ b/web/app/components/plugins/base/deprecation-notice.tsx
@@ -74,6 +74,7 @@ const DeprecationNotice: FC<DeprecationNoticeProps> = ({
<Trans
t={t}
i18nKey={`${i18nPrefix}.fullMessage`}
+ ns="plugin"
components={{
CustomLink: (
<Link
diff --git a/web/app/components/plugins/install-plugin/install-from-local-package/steps/install.tsx b/web/app/components/plugins/install-plugin/install-from-local-package/steps/install.tsx
index 484b1976aa4..1e36daefc1f 100644
--- a/web/app/components/plugins/install-plugin/install-from-local-package/steps/install.tsx
+++ b/web/app/components/plugins/install-plugin/install-from-local-package/steps/install.tsx
@@ -122,6 +122,7 @@ const Installed: FC<Props> = ({
<p>
<Trans
i18nKey={`${i18nPrefix}.fromTrustSource`}
+ ns="plugin"
components={{ trustSource: <span className="system-md-semibold" /> }}
/>
</p>
diff --git a/web/app/components/plugins/reference-setting-modal/auto-update-setting/index.tsx b/web/app/components/plugins/reference-setting-modal/auto-update-setting/index.tsx
index 93e7a01811c..4b4f7cb0b07 100644
--- a/web/app/components/plugins/reference-setting-modal/auto-update-setting/index.tsx
+++ b/web/app/components/plugins/reference-setting-modal/auto-update-setting/index.tsx
@@ -152,6 +152,7 @@ const AutoUpdateSetting: FC<Props> = ({
<div className="body-xs-regular mt-1 text-right text-text-tertiary">
<Trans
i18nKey={`${i18nPrefix}.changeTimezone`}
+ ns="plugin"
components={{
setTimezone: <SettingTimeZone />,
}}
diff --git a/web/app/components/rag-pipeline/components/rag-pipeline-header/publisher/popup.tsx b/web/app/components/rag-pipeline/components/rag-pipeline-header/publisher/popup.tsx
index aa1884d207d..b006c9acfbb 100644
--- a/web/app/components/rag-pipeline/components/rag-pipeline-header/publisher/popup.tsx
+++ b/web/app/components/rag-pipeline/components/rag-pipeline-header/publisher/popup.tsx
@@ -118,7 +118,8 @@ const Popup = () => {
children: (
<div className="system-xs-regular text-text-secondary">
<Trans
- i18nKey="datasetPipeline.publishPipeline.success.tip"
+ i18nKey="publishPipeline.success.tip"
+ ns="datasetPipeline"
components={{
CustomLink: (
<Link
diff --git a/web/app/components/workflow/block-selector/rag-tool-recommendations/index.tsx b/web/app/components/workflow/block-selector/rag-tool-recommendations/index.tsx
index e9df035a03a..3c62f488dcd 100644
--- a/web/app/components/workflow/block-selector/rag-tool-recommendations/index.tsx
+++ b/web/app/components/workflow/block-selector/rag-tool-recommendations/index.tsx
@@ -96,7 +96,8 @@ const RAGToolRecommendations = ({
{!isFetchingRAGRecommendedPlugins && recommendedPlugins.length === 0 && unInstalledPlugins.length === 0 && (
<p className="system-xs-regular px-3 py-1 text-text-tertiary">
<Trans
- i18nKey="pipeline.ragToolSuggestions.noRecommendationPlugins"
+ i18nKey="ragToolSuggestions.noRecommendationPlugins"
+ ns="pipeline"
components={{
CustomLink: (
<Link
diff --git a/web/package.json b/web/package.json
index 000113cde93..317502cb66c 100644
--- a/web/package.json
+++ b/web/package.json
@@ -89,7 +89,7 @@
"fast-deep-equal": "^3.1.3",
"html-entities": "^2.6.0",
"html-to-image": "1.11.13",
- "i18next": "^23.16.8",
+ "i18next": "^25.7.3",
"i18next-resources-to-backend": "^1.2.1",
"immer": "^11.1.0",
"js-audio-recorder": "^1.0.7",
@@ -118,7 +118,7 @@
"react-easy-crop": "^5.5.3",
"react-hook-form": "^7.65.0",
"react-hotkeys-hook": "^4.6.2",
- "react-i18next": "^15.7.4",
+ "react-i18next": "^16.5.0",
"react-markdown": "^9.1.0",
"react-multi-email": "^1.0.25",
"react-papaparse": "^4.4.0",
diff --git a/web/pnpm-lock.yaml b/web/pnpm-lock.yaml
index 5c2986c1909..a2d3debc3ce 100644
--- a/web/pnpm-lock.yaml
+++ b/web/pnpm-lock.yaml
@@ -184,8 +184,8 @@ importers:
specifier: 1.11.13
version: 1.11.13
i18next:
- specifier: ^23.16.8
- version: 23.16.8
+ specifier: ^25.7.3
+ version: 25.7.3([email protected])
i18next-resources-to-backend:
specifier: ^1.2.1
version: 1.2.1
@@ -271,8 +271,8 @@ importers:
specifier: ^4.6.2
react-i18next:
- specifier: ^15.7.4
+ specifier: ^16.5.0
react-markdown:
specifier: ^9.1.0
version: 9.1.0(@types/[email protected])([email protected])
@@ -5953,8 +5953,13 @@ packages:
resolution: {integrity: sha512-okHbVA+HZ7n1/76MsfhPqDou0fptl2dAlhRDu2ideXloRRduzHsqDOznJBef+R3DFZnbvWoBW+KxJ7fnFjd6Yw==}
- resolution: {integrity: sha512-06r/TitrM88Mg5FdUXAKL96dJMzgqLE5dv3ryBAra4KCwD9mJ4ndOTS95ZuymIGoE+2hzfdaMak2X11/es7ZWg==}
+ resolution: {integrity: sha512-2XaT+HpYGuc2uTExq9TVRhLsso+Dxym6PWaKpn36wfBmTI779OQ7iP/XaZHzrnGyzU4SHpFrTYLKfVyBfAhVNA==}
+ peerDependencies:
+ typescript: ^5
+ peerDependenciesMeta:
+ typescript:
+ optional: true
resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==}
@@ -7414,10 +7419,10 @@ packages:
react: '>=16.8.1'
react-dom: '>=16.8.1'
- resolution: {integrity: sha512-nyU8iKNrI5uDJch0z9+Y5XEr34b0wkyYj3Rp+tfbahxtlswxSCjcUL9H0nqXo9IR3/t5Y5PKIA3fx3MfUyR9Xw==}
+ resolution: {integrity: sha512-IMpPTyCTKxEj8klCrLKUTIUa8uYTd851+jcu2fJuUB9Agkk9Qq8asw4omyeHVnOXHrLgQJGTm5zTvn8HpaPiqw==}
peerDependencies:
- i18next: '>= 23.4.0'
+ i18next: '>= 25.6.2'
react: '>= 16.8.0'
react-dom: '*'
react-native: '*'
@@ -15124,9 +15129,11 @@ snapshots:
dependencies:
'@babel/runtime': 7.28.4
dependencies:
'@babel/runtime': 7.28.4
+ optionalDependencies:
+ typescript: 5.9.3
dependencies:
@@ -16877,12 +16884,13 @@ snapshots:
react: 19.2.3
react-dom: 19.2.3([email protected])
dependencies:
'@babel/runtime': 7.28.4
html-parse-stringify: 3.0.1
- i18next: 23.16.8
+ i18next: 25.7.3([email protected])
react: 19.2.3
+ use-sync-external-store: 1.6.0([email protected])
optionalDependencies:
react-dom: 19.2.3([email protected])
typescript: 5.9.3