Closed Bardreamaster closed 8 months ago
Hey @Bardreamaster, thank you for creating this PR to support multi-language documentation.
However, after I pulled from your branch and tested the documentation, I noticed that it doesn't seem to be working as expected.
@starjustice Yes I know there's problem as you see. As the problem I mentioned in the description:
Although most page looks good, there's still a problem I need help: As you click the logo on top-left, it will redirect to /version-2.0.0-beta even if you are in zh-Hans page before. It is caused by the home setting in documentation/src/pages/index.js which just redirect the home page by hard code like this:
It's because when you click zh-Hans option on dropdown tab, there's no avalible route for the main page.
So if you:
/version-2.0.0-beta/quick-start
) I'm not sure how docusaurus manage these routings for multi-language pages. That why I ask for help.
Maybe you can try as i say. Thanks.
And another comment for this PR.
Could you please change the merge branch from alpha-v2
to v2.0.0-beta
?
Starting from now, we will be updating new changes in the v2.0.0-beta
branch, and the alpha-v2
branch will be deleted.
@starjustice Yes I know there's problem as you see. As the problem I mentioned in the description:
Although most page looks good, there's still a problem I need help: As you click the logo on top-left, it will redirect to /version-2.0.0-beta even if you are in zh-Hans page before. It is caused by the home setting in documentation/src/pages/index.js which just redirect the home page by hard code like this:
It's because when you click zh-Hans option on dropdown tab, there's no avalible route for the main page.
So if you:
- First, select a specific page which is not the main page. (example:
/version-2.0.0-beta/quick-start
)- Then change to Chinese.
- You'll see the chinese page for this page.
I'm not sure how docusaurus manage these routings for multi-language pages. That why I ask for help.
Maybe you can try as i say. Thanks.
Hey @Bardreamaster thanks for reply my comment. I have already tried your steps and we will added this in our sprint to be fix
And another comment for this PR.
Could you please change the merge branch from
alpha-v2
tov2.0.0-beta
? Starting from now, we will be updating new changes in thev2.0.0-beta
branch, and thealpha-v2
branch will be deleted.
@starjustice I'v changed. Thanks for reply.
Hey @Bardreamaster just want to inform I already made some changes in this PR for page/index.js Maybe you can check and try again after these changes
changes
@starjustice Thanks for reply and sorry for reply too late.
I've pull the latest update to check if the main page redirect is right. Unfortunately, there are problems:
http://127.0.0.1:3000/zh-Hans/version-2.0.0-beta/
directly, it returns 404.http://127.0.0.1:3000/version-2.0.0-beta/
, it still returns 404.http://127.0.0.1:3000/version-2.0.0-beta/quick-start
, then change into Chinese. And select the /Lexicon/introduction
tab on sidebar, you can enter the "main page" with browser address bar shows http://127.0.0.1:3000/zh-Hans/version-2.0.0-beta/
which is the same as before.I'm very confused about it. Hope you can help to solve.
I'll keep translate content while you are fixing it.
Hey @Bardreamaster, could you please change the target merge branch from v2.0.0-beta
to master
? This will allow us to reopen this PR.
Type of PR
style:
andperf:
commits)Description
I added the docs i18n files refer to the docusaurus i18n doc. With it, we can translate docs using git. It will create a folder contains all i18n files includes docs, theme, plugins..... We only have to initialize the folder and translate the text, then push back.
I have translate two pages for review and test the workflow, which are
intro
at/zh-Hans/version-2.0.0-beta/
andquick-start
at/zh-Hans/version-2.0.0-beta/quick-start
.To view the translation, you only have to build and serve the docs locally.
Although most page looks good, there's still a problem I need help:
As you click the logo on top-left, it will redirect to
/version-2.0.0-beta
even if you are in zh-Hans page before. It is caused by the home setting indocumentation/src/pages/index.js
which just redirect the home page by hard code like this:So, you cannot jump into a homepage with other language. Please help to fix that. If necessary, I'll put it in issue.
And after checking this i18n related workflow, I could keep translate docs.
Changes
/i18n