Skip to content
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

About the i18n of blogs #623

Closed
Baoyuantop opened this issue Sep 23, 2021 · 5 comments · Fixed by #634 or #637
Closed

About the i18n of blogs #623

Baoyuantop opened this issue Sep 23, 2021 · 5 comments · Fixed by #634 or #637
Labels
Enhancement New feature or request

Comments

@Baoyuantop
Copy link
Contributor

Actual Behaviour

Currently, our blogs are mixed in English and Chinese. All blogs are displayed whether in English or Chinese. This often brings confusion and inconvenience to users of different languages.

Expected Behaviour

When the current environment is in English, only English blogs are displayed, and in the Chinese environment, only Chinese blogs are displayed.

After analysis, we can use the draft property of the markdown file to solve, It means that the current document is still in draft and will not be displayed in the blog.

So because we default to the English environment, add the draft property to all Chinese blogs in the website/blog directory.

After that, copy all the blog files to the website/i18n/zh/docusaurus-plugin-content-blog directory, and then add the draft property to all English blogs.

Note: draft will still be displayed in development mode, but after build, it works ~

What do you think?

@juzhiyuan juzhiyuan added the Enhancement New feature or request label Sep 23, 2021
@liuxiran
Copy link
Contributor

Hi @Baoyuantop , there is a pr about split blog into Chinese and English, see if it matches your original claim.

@guoqqqi
Copy link
Member

guoqqqi commented Sep 23, 2021

Hi, @Baoyuantop https://www.docusaurus.cn/docs/i18n/introduction#translation-files-location Here is a guide to supporting i18n, which I think we should use to solve the problem

@bzp2010
Copy link
Contributor

bzp2010 commented Sep 23, 2021

Hi, @Baoyuantop https://www.docusaurus.cn/docs/i18n/introduction#translation-files-location Here is a guide to supporting i18n, which I think we should use to solve the problem

+1 agree

@Baoyuantop
Copy link
Contributor Author

Hi, @Baoyuantop https://www.docusaurus.cn/docs/i18n/introduction#translation-files-location Here is a guide to supporting i18n, which I think we should use to solve the problem

OK, I'll try this method.

@bzp2010
Copy link
Contributor

bzp2010 commented Sep 23, 2021

Hi, @Baoyuantop https://www.docusaurus.cn/docs/i18n/introduction#translation-files-location Here is a guide to supporting i18n, which I think we should use to solve the problem

OK, I'll try this method.

At the same time, you can also find it in the PR list. I remember some contributors did it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request
Projects
None yet
5 participants