Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 17 additions & 16 deletions docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -58,22 +59,22 @@ 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 }) => {
// // @ts-ignore
// 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,
Expand Down Expand Up @@ -104,15 +105,15 @@ 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) => {
// @ts-ignore
// 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}`;
},
},
],
Expand All @@ -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}`;
},
},
],
Expand All @@ -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}`;
},
},
],
Expand All @@ -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}`;
},
},
],
Expand All @@ -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}`;
},
},
],
Expand All @@ -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}`;
},
},
],
Expand Down
4 changes: 4 additions & 0 deletions i18n/en/code.json
Original file line number Diff line number Diff line change
Expand Up @@ -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."
}
}
14 changes: 9 additions & 5 deletions i18n/zh/code.json
Original file line number Diff line number Diff line change
Expand Up @@ -710,31 +710,31 @@
"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.": {
"message": "兼容标准 SQL,支持流式聚合,为 BI 分析注入实时动力。",
"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.": {
"message": "向量数据与语义检索,皆可使用 SQL 直接完成。",
"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.": {
"message": "融合倒排索引与全文检索,高效支撑混合检索应用。",
"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.": {
Expand Down Expand Up @@ -860,5 +860,9 @@
"Releases": {
"message": "版本发布",
"description": "Releases"
},
"All rights reserved.": {
"message": "© {year} Databend 社区。版权所有。",
"description": "All rights reserved."
}
}
}
32 changes: 30 additions & 2 deletions i18n/zh/docusaurus-theme-classic/footer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -30,5 +30,33 @@
"copyright": {
"message": "Copyright © 2023 Datafuse Labs, Inc. Built with Docusaurus. <br><br> <img src=\"https://www.datocms-assets.com/31049/1618983297-powered-by-vercel.svg\">",
"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"
}
}
4 changes: 2 additions & 2 deletions src/theme/Footer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down Expand Up @@ -163,7 +163,7 @@ function Footer() {
})}
</div>
<div className={styles.footerCopyright}>
<p>Copyright © {year} The Databend Community. All rights reserved.</p>
<p>{$t("All rights reserved.", true, { year })}</p>
</div>
</footer>
);
Expand Down
11 changes: 7 additions & 4 deletions src/utils/tools.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,14 @@ export function shouldShowConsent() {
return !cookie;
}

function $t(text: string, isText = true): string | any {
function $t(text: string, isText = true, values?: any): string | any {
if (isText) {
return translate({
message: text,
});
return translate(
{
message: text,
},
values
);
}
return <Translate>{text}</Translate>;
}
Expand Down
Loading