Open
Description
Have you read the Contributing Guidelines on issues?
- I have read the Contributing Guidelines on issues.
Prerequisites
- I'm using the latest version of Docusaurus.
- I have tried the
npm run clear
oryarn clear
command. - I have tried
rm -rf node_modules yarn.lock package-lock.json
and re-installing packages. - I have tried creating a repro with https://new.docusaurus.io.
- I have read the console error message carefully (if applicable).
Description
I am currently internationalizing (i18n) a document written in Korean into English.
The sidebar of my document is all autogenerated sidebar.
// sidebar.js
/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
const sidebars = {
// By default, Docusaurus generates a sidebar from the docs folder structure
exampleSidebar: [{ type: 'autogenerated', dirName: 'example-dir' }],
};
module.exports = sidebars;
I have copied the /docs
subfolders originally written in Korean to /i18n/en/docusaurus-plugin-content-docs
and I am translating the documents into English. However, even if I change the label
attribute in /i18n/en/docusaurus-plugin-content-docs/example-dir/under-example-dir/_category_.yml
to English, it continues to appear in Korean in the sidebar.
# /i18n/en/docusaurus-plugin-content-docs/example-dir/under-example-dir/_category_.yml
position: 2
label: 'Example'
collapsible: true
collapsed: false
# /docs/example-dir/under-example-dir/_category_.yml
position: 2
label: '예제'
collapsible: true
collapsed: false
I run docusaurus following step:
yarn dev --locale en
But in example-dir
sidebar, it displays Korean, not English.
I already wrote about this in #8986
Reproducible demo
https://github.com/dogu-team/dogu-docs
Steps to reproduce
- Clone or fork https://github.com/dogu-team/dogu-docs this repository and open
- Checkout branch to
label_reproduce
- Enter
yarn newbie
- Change
docs/host-and-device/host/_category_.yml
asposition: 2 label: '호스트' collapsible: true collapsed: false
- Check
i18n/en/docusaurus-plugin-content-docs/current/host-and-device/host/_category_.yml
. This should beposition: 2 label: 'Host' collapsible: true collapsed: false
yarn dev --locale en
oryarn build && yarn serve
- Go to http://localhost:3100/en/host-and-device/host/get-started and check sidebar.
- Sidebar label will still '호스트'(korean), not 'Host'.
Expected behavior
Sidebar label should be 'Host', not Korean
Actual behavior
Sidebar label shows '호스트', not English
Your environment
- Public source code: https://github.com/dogu-team/dogu-docs/tree/label_reproduce
- Public site URL: https://docs.dogutech.io
- Docusaurus version used: 2.4.1
- Environment name and version (e.g. Chrome 89, Node.js 16.4): Node.js 16.16.0
- Operating system and version (e.g. Ubuntu 20.04.2 LTS): macOS Ventura 13.13.1 (a)
Self-service
- I'd be willing to fix this bug myself.