-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve i18n DX to translate the _category_.yml
labels
#8996
Comments
I got the same problem here; I don't know if this is a bug or if the |
Hi! I18n does not use |
@Josh-Cena another person reported the same problem here: #8986 I think we can re-open and try to figure out how we can improve the UX/DX on this specific case to make the behavior more intuitive. We already allow to partially translate front matter (SEO description etc) so I guess it could make sense to also allow partial translation of the |
_category_.yml
label with i18n not working_category_.yml
labels
That will be awesome! |
@Lorde627 what you describe here is a totally different problem: let's not discuss all i18n issues here. I shared a temporary workaround on how to use different Docusaurus site configs on a per-locale basis: #4542 (comment) This is not an ideal API/DX but it allows you to customize title/tagline/navbar/footer per locale. |
@slorber To me it sounds inconsistent to have a 3rd way to translate content. We already have the model of "Markdown + JSON" and there are relatively few places to look for for translated text. Now we will have to deal with priorities (because the JSON is always going to be emitted anyway; If our goal for this issue is only to "improve DX", the only option I feel comfortable with is emitting a warning message if we find |
Let's keep it open for now, need to think about it a bit more 🤪 The thing is, I'd like to make it possible to translate content by using localized file extensions. Many other docs solutions do this and it's more convenient in many cases:
If we implement this but do not allow to translate category labels directly through the For example Nextra: https://nextra.site/docs/guide/i18n#use-add-locale-to-filenames /pages
_meta.en.json
_meta.zh.json
_meta.de.json
index.en.md
index.zh.md
index.de.md
... The |
Finally I found the solution for autogenerated sidebar with i18n:
Also, I couldn't find any information on the autogenerated sidebar documentation page about not being able to use i18n functionality when using |
I'm surprised by steps 1 and 3 in your workaround! That's not how I understand translations work at all. We would need to look into this; maybe there actually is a bug. |
Ohh... I see.🥲 Then is there any solution to apply "working on the right way" translations to autogenerated sidebar labels? I couldn't find some examples for this. Or, configuring sidebars in |
second this, the official documentation did not mention this part at all |
When you run |
Have you read the Contributing Guidelines on issues?
Prerequisites
npm run clear
oryarn clear
command.rm -rf node_modules yarn.lock package-lock.json
and re-installing packages.Description
I am currently internationalizing (i18n) a document written in Korean into English.
The sidebar of my document is all autogenerated sidebar.
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 thelabel
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.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
label_reproduce
yarn newbie
docs/host-and-device/host/_category_.yml
asi18n/en/docusaurus-plugin-content-docs/current/host-and-device/host/_category_.yml
. This should beyarn dev --locale en
oryarn build && yarn serve
Expected behavior
Sidebar label should be 'Host', not Korean
Actual behavior
Sidebar label shows '호스트', not English
Your environment
Self-service
The text was updated successfully, but these errors were encountered: