vitepress icon indicating copy to clipboard operation
vitepress copied to clipboard

[i18n]: always naviageto init page when language change not the corresponding URL

Open Sepush opened this issue 3 years ago • 3 comments

Describe the bug

with a config file like this https://github.com/tensorchord/envd-docs/blob/main/docs/.vitepress/config.ts when we change the language of doc it did not naviagative to corresponding URL

Reproduction

eg. when we in this page https://envd.tensorchord.ai/zh/guide/build-envd.html we click the button to change the language image we expect it naviagte to https://envd.tensorchord.ai/guide/build-envd.html not https://envd.tensorchord.ai/guide/getting-started.html

Expected behavior

naviagte to corresponding URL

System Info

win 10 chrome 103

Additional context

I'm not sure whether it been fixed on i18n branch or is there any way I have miss to achive this for now.

Validations

  • [X] Follow our Code of Conduct
  • [X] Read the docs.
  • [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.

Sepush avatar Aug 30 '22 05:08 Sepush

I think it hasn't started yet, related https://github.com/vuejs/vitepress/issues/631

You can find not only URL router, like navbar text, search text ... We are all looking forward to the feature, maybe we need to complete other features before designing it. The current I18 I use the double site to complete.

Zhengqbbb avatar Aug 30 '22 06:08 Zhengqbbb

We are all looking forward to the feature

Yeah, its definitely on my priority list. i18n hopefully will be ready for review before next week.


But still I don't think we'll be able to cover this use-case initially. There are complexities with this, like many people like to change file name too, not just the zh/en part, or maybe a page might not have a corresponding page in the other language. What to do in such cases?

brc-dd avatar Aug 30 '22 08:08 brc-dd

We are all looking forward to the feature

Yeah, its definitely on my priority list. i18n hopefully will be ready for review before next week.

But still I don't think we'll be able to cover this use-case initially. There are complexities with this, like many people like to change file name too, not just the zh/en part, or maybe a page might not have a corresponding page in the other language. What to do in such cases?

It's not easy.How about resolve base on the sidebar config? As usually if we have different language docs we also have the different sidebar config. So that we cant get the info of correct path from it.

Sepush avatar Aug 31 '22 13:08 Sepush