This is an automated email from the ASF dual-hosted git repository.
shuai pushed a change to branch social-img
in repository https://gitbox.apache.org/repos/asf/incubator-answer-website.git
at 491fca09 fix: add dos sidebar translate
This branch includes the following new commits:
new 491fca09 fix: add dos sidebar translate
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
This is an automated email from the ASF dual-hosted git repository.
shuai pushed a commit to branch social-img
in repository https://gitbox.apache.org/repos/asf/incubator-answer-website.git
commit 491fca09b5e8afc83ba572e3fd09653ac28fe101
Author: shuai <li...@sifou.com>
AuthorDate: Thu Feb 29 12:25:40 2024 +0800
fix: add dos sidebar translate
---
i18n/zh-CN/code.json | 9 +++++++++
i18n/zh-CN/docusaurus-plugin-content-docs/current.json | 4 ++--
src/theme/DocSidebarItem/Category/index.tsx | 9 ++++++++-
3 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/i18n/zh-CN/code.json b/i18n/zh-CN/code.json
index 1f284a4e..78cd85cf 100644
--- a/i18n/zh-CN/code.json
+++ b/i18n/zh-CN/code.json
@@ -574,5 +574,14 @@
},
"plugins.instruction.join": {
"message": "加入我们的社区"
+ },
+ "docs.sidebar.tutorialSidebar.category.Getting Started": {
+ "message": "入门"
+ },
+ "docs.sidebar.tutorialSidebar.category.User Guides": {
+ "message": "用户指南"
+ },
+ "docs.sidebar.tutorialSidebar.category.Developer Guides": {
+ "message": "开发者指南"
}
}
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current.json b/i18n/zh-CN/docusaurus-plugin-content-docs/current.json
index c286665b..afc78e1f 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current.json
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current.json
@@ -23,9 +23,9 @@
"message": "贡献",
"description": "The label for category Contributing in sidebar tutorialSidebar"
},
- "sidebar.tutorialSidebar.link.Getting Started": {
+ "sidebar.tutorialSidebar.category.Getting Started": {
"message": "入门",
- "description": "The label for link Getting Started in sidebar tutorialSidebar, linking to #"
+ "description": "The label for category Contents Management in sidebar tutorialSidebar"
},
"sidebar.tutorialSidebar.link.Recipes": {
"message": "教程",
diff --git a/src/theme/DocSidebarItem/Category/index.tsx b/src/theme/DocSidebarItem/Category/index.tsx
index 8890a804..da633810 100644
--- a/src/theme/DocSidebarItem/Category/index.tsx
+++ b/src/theme/DocSidebarItem/Category/index.tsx
@@ -80,6 +80,7 @@ function CollapseButton({
categoryLabel: string;
onClick: ComponentProps<'button'>['onClick'];
}) {
+ console.log('categoryLabel', categoryLabel);
return (
<button
aria-label={
@@ -156,6 +157,8 @@ export default function DocSidebarItemCategory({
}
}, [collapsible, expandedItem, index, setCollapsed, autoCollapseCategories]);
+ console.log('collapsed', item);
+
return (
<li
className={clsx(
@@ -196,7 +199,11 @@ export default function DocSidebarItemCategory({
aria-expanded={collapsible ? !collapsed : undefined}
href={collapsible ? hrefWithSSRFallback ?? '#' : hrefWithSSRFallback}
{...props}>
- {label}
+ {translate({
+ id: `docs.sidebar.tutorialSidebar.category.${label}`,
+ message: label,
+ },
+ {label: label},)}
</Link>
{href && collapsible && (
<CollapseButton