From c2d47cd2e1cb24c8621b0ffd4cac707e7f48ea00 Mon Sep 17 00:00:00 2001 From: Benjamin Date: Mon, 5 Feb 2024 18:40:20 +0800 Subject: [PATCH] fix:add translation for dataset knowledge and update document title (#2396) --- web/app/(commonLayout)/datasets/Datasets.tsx | 4 ++++ web/i18n/lang/app.en.ts | 2 +- web/i18n/lang/app.pt.ts | 2 +- web/i18n/lang/app.zh.ts | 2 +- web/i18n/lang/dataset.pt.ts | 1 + web/i18n/lang/explore.en.ts | 2 +- web/i18n/lang/explore.pt.ts | 2 +- web/i18n/lang/explore.zh.ts | 2 +- 8 files changed, 11 insertions(+), 6 deletions(-) diff --git a/web/app/(commonLayout)/datasets/Datasets.tsx b/web/app/(commonLayout)/datasets/Datasets.tsx index 0bec39fe10..adaf378975 100644 --- a/web/app/(commonLayout)/datasets/Datasets.tsx +++ b/web/app/(commonLayout)/datasets/Datasets.tsx @@ -3,6 +3,7 @@ import { useEffect, useRef } from 'react' import useSWRInfinite from 'swr/infinite' import { debounce } from 'lodash-es' +import { useTranslation } from 'react-i18next' import NewDatasetCard from './NewDatasetCard' import DatasetCard from './DatasetCard' import type { DataSetListResponse } from '@/models/datasets' @@ -27,8 +28,11 @@ const Datasets = ({ const loadingStateRef = useRef(false) const anchorRef = useRef(null) + const { t } = useTranslation() + useEffect(() => { loadingStateRef.current = isLoading + document.title = `${t('dataset.knowledge')} - Dify` }, [isLoading]) useEffect(() => { diff --git a/web/i18n/lang/app.en.ts b/web/i18n/lang/app.en.ts index b4334b04be..942841ca2f 100644 --- a/web/i18n/lang/app.en.ts +++ b/web/i18n/lang/app.en.ts @@ -1,5 +1,5 @@ const translation = { - title: 'Apps', + title: 'Studio', createApp: 'Create new App', types: { all: 'All', diff --git a/web/i18n/lang/app.pt.ts b/web/i18n/lang/app.pt.ts index 26b3976b26..2a13511c72 100644 --- a/web/i18n/lang/app.pt.ts +++ b/web/i18n/lang/app.pt.ts @@ -1,5 +1,5 @@ const translation = { - title: 'Aplicativos', + title: 'Studio', createApp: 'Criar novo aplicativo', modes: { completion: 'Gerador de Texto', diff --git a/web/i18n/lang/app.zh.ts b/web/i18n/lang/app.zh.ts index 1d52deb663..ce1b6b1cf1 100644 --- a/web/i18n/lang/app.zh.ts +++ b/web/i18n/lang/app.zh.ts @@ -1,5 +1,5 @@ const translation = { - title: '应用', + title: '工作室', createApp: '创建应用', types: { all: '全部', diff --git a/web/i18n/lang/dataset.pt.ts b/web/i18n/lang/dataset.pt.ts index 3384b0ef2a..3ca5fca157 100644 --- a/web/i18n/lang/dataset.pt.ts +++ b/web/i18n/lang/dataset.pt.ts @@ -1,4 +1,5 @@ const translation = { + knowledge: 'Wiedza', documentCount: ' documentos', wordCount: 'k palavras', appCount: ' aplicativos vinculados', diff --git a/web/i18n/lang/explore.en.ts b/web/i18n/lang/explore.en.ts index 5af34cb37e..330ae84b3a 100644 --- a/web/i18n/lang/explore.en.ts +++ b/web/i18n/lang/explore.en.ts @@ -1,5 +1,5 @@ const translation = { - title: 'My Apps', + title: 'Explore', sidebar: { discovery: 'Discovery', chat: 'Chat', diff --git a/web/i18n/lang/explore.pt.ts b/web/i18n/lang/explore.pt.ts index 8ccf09b4fe..c188a8eb94 100644 --- a/web/i18n/lang/explore.pt.ts +++ b/web/i18n/lang/explore.pt.ts @@ -1,5 +1,5 @@ const translation = { - title: 'Minhas Aplicações', + title: 'Badać', sidebar: { discovery: 'Descoberta', chat: 'Chat', diff --git a/web/i18n/lang/explore.zh.ts b/web/i18n/lang/explore.zh.ts index dbc14f6e06..84a78d6ac0 100644 --- a/web/i18n/lang/explore.zh.ts +++ b/web/i18n/lang/explore.zh.ts @@ -1,5 +1,5 @@ const translation = { - title: '我的应用', + title: '探索', sidebar: { discovery: '发现', chat: '智聊',