From 22677a371f62291d388574a5f541b8e4cf80d1ff Mon Sep 17 00:00:00 2001
From: q <787025321@qq.com>
Date: Fri, 28 Nov 2025 15:39:56 +0800
Subject: [PATCH] fix: i18n configs
---
docusaurus.config.ts | 33 ++++++++++----------
i18n/en/code.json | 4 +++
i18n/zh/code.json | 14 ++++++---
i18n/zh/docusaurus-theme-classic/footer.json | 32 +++++++++++++++++--
src/theme/Footer/index.tsx | 4 +--
src/utils/tools.tsx | 11 ++++---
6 files changed, 69 insertions(+), 29 deletions(-)
diff --git a/docusaurus.config.ts b/docusaurus.config.ts
index 2b779a8bcb..a355fdea46 100644
--- a/docusaurus.config.ts
+++ b/docusaurus.config.ts
@@ -6,7 +6,8 @@ import siteRedirects from './site-redirects';
const { site } = process.env;
-const isCN = (site || "cn") === "cn";
+const siteName = site || "cn";
+const isCN = siteName === "cn";
const lang = isCN ? "zh" : "en";
const { site_env } = process.env;
@@ -58,14 +59,14 @@ const config: Config = {
cloudLink: siteConfig[lang].cloudLink,
blogTags: ["weekly", "databend"],
askBendUrl: isProduction ? ASKBEND_URL : "",
- site
+ site: siteName,
},
presets: [
[
'classic',
{
docs: {
- path: `./docs/${site}/guides`,
+ path: `./docs/${siteName}/guides`,
routeBasePath: "guides",
sidebarPath: "./docs/en/sidebars.js",
editUrl: ({ locale, docPath }) => {
@@ -73,7 +74,7 @@ const config: Config = {
// if (locale !== config.i18n.defaultLocale) {
// return `https://databend.crowdin.com/databend/${locale}`;
// }
- return `https://github.com/databendlabs/databend-docs/tree/main/docs/${site}/guides/${docPath}`;
+ return `https://github.com/databendlabs/databend-docs/tree/main/docs/${siteName}/guides/${docPath}`;
},
},
blog: false,
@@ -104,7 +105,7 @@ const config: Config = {
/** @type {import('@docusaurus/plugin-content-docs').Options} */
{
id: "dev",
- path: `./docs/${site}/dev`,
+ path: `./docs/${siteName}/dev`,
routeBasePath: "dev",
sidebarPath: "./docs/en/sidebars.js",
editUrl: ({ locale, devPath }: any) => {
@@ -112,7 +113,7 @@ const config: Config = {
// if (locale !== config.i18n.defaultLocale) {
// return `https://databend.crowdin.com/databend/${locale}`;
// }
- return `https://github.com/databendlabs/databend-docs/edit/main/docs/dev/${devPath}`;
+ return `https://github.com/databendlabs/databend-docs/edit/main/docs/${siteName}/dev/${devPath}`;
},
},
],
@@ -121,11 +122,11 @@ const config: Config = {
/** @type {import('@docusaurus/plugin-content-docs').Options} */
{
id: "tutorials",
- path: `./docs/${site}/tutorials`,
+ path: `./docs/${siteName}/tutorials`,
routeBasePath: "tutorials",
sidebarPath: "./docs/en/sidebars.js",
editUrl: ({ locale, docPath }: any) => {
- return `https://github.com/databendlabs/databend-docs/tree/main/docs/${site}/tutorials/${docPath}`;
+ return `https://github.com/databendlabs/databend-docs/tree/main/docs/${siteName}/tutorials/${docPath}`;
},
},
],
@@ -134,11 +135,11 @@ const config: Config = {
/** @type {import('@docusaurus/plugin-content-docs').Options} */
{
id: "sqlReference",
- path: `./docs/${site}/sql-reference`,
+ path: `./docs/${siteName}/sql-reference`,
routeBasePath: "sql",
sidebarPath: "./docs/en/sidebars.js",
editUrl: ({ locale, docPath }: any) => {
- return `https://github.com/databendlabs/databend-docs/edit/main/docs/${site}/sql-reference/${docPath}`;
+ return `https://github.com/databendlabs/databend-docs/edit/main/docs/${siteName}/sql-reference/${docPath}`;
},
},
],
@@ -147,11 +148,11 @@ const config: Config = {
/** @type {import('@docusaurus/plugin-content-docs').Options} */
{
id: "releaseNotes",
- path: `./docs/${site}/release-notes`,
+ path: `./docs/${siteName}/release-notes`,
routeBasePath: "release-notes",
sidebarPath: "./docs/en/sidebars.js",
editUrl: ({ locale, docPath }: any) => {
- return `https://github.com/databendlabs/databend-docs/edit/main/docs/${site}/release-notes/${docPath}`;
+ return `https://github.com/databendlabs/databend-docs/edit/main/docs/${siteName}/release-notes/${docPath}`;
},
},
],
@@ -160,11 +161,11 @@ const config: Config = {
/** @type {import('@docusaurus/plugin-content-docs').Options} */
{
id: "developer",
- path: `./docs/${site}/developer`,
+ path: `./docs/${siteName}/developer`,
routeBasePath: "developer",
sidebarPath: "./docs/en/sidebars.js",
editUrl: ({ locale, docPath }: any) => {
- return `https://github.com/databendlabs/databend-docs/edit/main/docs/${site}/developer/${docPath}`;
+ return `https://github.com/databendlabs/databend-docs/edit/main/docs/${siteName}/developer/${docPath}`;
},
},
],
@@ -173,11 +174,11 @@ const config: Config = {
/** @type {import('@docusaurus/plugin-content-docs').Options} */
{
id: "integrations",
- path: `./docs/${site}/integrations`,
+ path: `./docs/${siteName}/integrations`,
routeBasePath: "integrations",
sidebarPath: "./docs/en/sidebars.js",
editUrl: ({ locale, docPath }: any) => {
- return `https://github.com/databendlabs/databend-docs/edit/main/docs/${site}/integrations/${docPath}`;
+ return `https://github.com/databendlabs/databend-docs/edit/main/docs/${siteName}/integrations/${docPath}`;
},
},
],
diff --git a/i18n/en/code.json b/i18n/en/code.json
index 0070849af3..ef59d5e6cd 100644
--- a/i18n/en/code.json
+++ b/i18n/en/code.json
@@ -832,5 +832,9 @@
"Open in": {
"message": "Open in",
"description": "Open in"
+ },
+ "All rights reserved.": {
+ "message": "Copyright © {year} The Databend Community. All rights reserved.",
+ "description": "All rights reserved."
}
}
diff --git a/i18n/zh/code.json b/i18n/zh/code.json
index c63c34c496..6ef6eee7fd 100644
--- a/i18n/zh/code.json
+++ b/i18n/zh/code.json
@@ -710,7 +710,7 @@
"description": "Description for unified data feature"
},
"Analytics Native": {
- "message": "原生 SQL 分析(Analytics)",
+ "message": "原生 SQL 分析 (Analytics)",
"description": "Headline for analytics native feature"
},
"ANSI SQL, windowing, incremental aggregates, and streaming power BI.": {
@@ -718,7 +718,7 @@
"description": "Description for analytics native feature"
},
"Vector Native": {
- "message": "原生向量支持(Vector)",
+ "message": "原生向量支持 (Vector)",
"description": "Headline for vector native feature"
},
"Embeddings, vector indexes, and semantic retrieval all run in SQL.": {
@@ -726,7 +726,7 @@
"description": "Description for vector native feature"
},
"Search Native": {
- "message": "原生搜索能力(Search)",
+ "message": "原生搜索能力 (Search)",
"description": "Headline for search native feature"
},
"Full-text search and inverted indexes fuel hybrid retrieval.": {
@@ -734,7 +734,7 @@
"description": "Description for search native feature"
},
"Geo Native": {
- "message": "原生地理空间(Geospatial)",
+ "message": "原生地理空间 (Geospatial)",
"description": "Headline for geo native feature"
},
"Geospatial indexes and functions power map and location services.": {
@@ -860,5 +860,9 @@
"Releases": {
"message": "版本发布",
"description": "Releases"
+ },
+ "All rights reserved.": {
+ "message": "© {year} Databend 社区。版权所有。",
+ "description": "All rights reserved."
}
-}
\ No newline at end of file
+}
diff --git a/i18n/zh/docusaurus-theme-classic/footer.json b/i18n/zh/docusaurus-theme-classic/footer.json
index 9b5e229b65..0fb1f0e1ee 100644
--- a/i18n/zh/docusaurus-theme-classic/footer.json
+++ b/i18n/zh/docusaurus-theme-classic/footer.json
@@ -8,8 +8,8 @@
"description": "The title of the footer links column with title=COMMUNITY in the footer"
},
"link.item.label.Performance": {
- "message": "Performance",
- "description": "The label of footer link with label=Performance linking to https://www.databend.cn/blog/clickbench-databend-top"
+ "message": "性能",
+ "description": "The label of footer link with label=Performance linking to /guides/benchmark/"
},
"link.item.label.Deployment": {
"message": "Deployment",
@@ -30,5 +30,33 @@
"copyright": {
"message": "Copyright © 2023 Datafuse Labs, Inc. Built with Docusaurus.
",
"description": "The footer copyright"
+ },
+ "link.item.label.Visit Databend": {
+ "message": "访问官网",
+ "description": "The label of footer link with label=Visit Databend linking to https://www.databend.cn"
+ },
+ "link.item.label.Products": {
+ "message": "Databend 产品",
+ "description": "The label of footer link with label=Products linking to /guides/"
+ },
+ "link.item.label.AI": {
+ "message": "AI",
+ "description": "The label of footer link with label=AI linking to /guides/ai-functions"
+ },
+ "link.item.label.Downloads": {
+ "message": "下载",
+ "description": "The label of footer link with label=Downloads linking to https://www.databend.cn/download/"
+ },
+ "link.item.label.Developer": {
+ "message": "开发者",
+ "description": "The label of footer link with label=Developer linking to /developer/"
+ },
+ "link.item.label.Blog": {
+ "message": "博客",
+ "description": "The label of footer link with label=Blog linking to https://www.databend.cn/blog/"
+ },
+ "link.item.label.X": {
+ "message": "X",
+ "description": "The label of footer link with label=X linking to https://x.com/DatabendLabs"
}
}
diff --git a/src/theme/Footer/index.tsx b/src/theme/Footer/index.tsx
index 71b30c55a1..1cba995881 100644
--- a/src/theme/Footer/index.tsx
+++ b/src/theme/Footer/index.tsx
@@ -18,7 +18,7 @@ import ExecutionEnvironment from "@docusaurus/ExecutionEnvironment";
import "vanilla-cookieconsent/dist/cookieconsent.css";
import * as CookieConsent from "vanilla-cookieconsent";
import pluginConfig from "@site/src/components/Config/CookieConsentConfig";
-import { shouldShowConsent } from "@site/src/utils/tools";
+import $t, { shouldShowConsent } from "@site/src/utils/tools";
// import ProgressBar from "react-scroll-progress-bar";
const COOKIES_CLASS = "show--consent";
@@ -163,7 +163,7 @@ function Footer() {
})}
Copyright © {year} The Databend Community. All rights reserved.
+{$t("All rights reserved.", true, { year })}