content icon indicating copy to clipboard operation
content copied to clipboard

Docs links not including locale in path

Open antoineneff opened this issue 6 years ago • 4 comments

Version

Actual website

Reproduction Link

https://content.nuxtjs.org/

Steps to reproduce

Go to one of translated version of docs and click on an internal link (https://content.nuxtjs.org/fr/writing#markdown and first link in this section for example).

What is Expected?

Should redirect to locale version of doc.

What is actually happening?

Redirects to default (english) version of docs, it omits the locale path part.

Should it be added in the links or the config is missing something ?

antoineneff avatar Oct 06 '20 17:10 antoineneff

@antoineneff

I dug into this bug and have submitted a draft PR. The bug itself seems fixed but I'm having troubles in creating test cases. I do appreciate if you take a look at my PR and give me some advice. 👶

nozomuikuta avatar Oct 23 '20 17:10 nozomuikuta

Update:

I submitted #598 to fix this issue at @nuxt/content layer. But, @benjamincanac pointed it out that this bug should be fixed at @nuxt/content-theme-docs level, rather than @nuxt/content level. This is because @nuxt/content itself is not designed to depend on nuxt-i18n. Yes, I also agree with the design.

He said he would look into this issue, so I hope he will fix it in near future. 👏

nozomuikuta avatar Oct 26 '20 10:10 nozomuikuta

@NozomuIkuta I'm still thinking about this, should the theme really force all the relative links to the good locale? What if you want to create links to other locales or to the default one?

benjamincanac avatar Nov 02 '20 11:11 benjamincanac

Actually I ran into this same problem when translating, if a page is not ready (not translated yet), you might want to link to the english version.

Thank you for your time @NozomuIkuta & @benjamincanac !

antoineneff avatar Nov 02 '20 12:11 antoineneff