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

Localized links #3669

Open
jonasschultheiss opened this issue Nov 7, 2024 · 3 comments
Open

Localized links #3669

jonasschultheiss opened this issue Nov 7, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@jonasschultheiss
Copy link

Describe the bug

Links in a localized documentation require manual editing when translating.

To Reproduce Steps to reproduce the behavior:

  1. Create a localized documentation with atleast two languages.
  2. Create two pages for one language.
  3. Link from one page to the other with md links
  4. The language code won't get added dynamically, you have to manually do this.

Expected behavior A clear and concise description of what you expected to
happen.

I want that the language in a markdown link gets inferred by next, so that I don't have to keep this change in mind when translating.

@jonasschultheiss jonasschultheiss added the bug Something isn't working label Nov 7, 2024
@dimaMachina
Copy link
Collaborator

please share a visual example, I am not sure I get it

@arno-fukuda
Copy link
Contributor

Taking a guess here.

Previously in v2:

  • We had next i18n
  • When you wrote [Home](/home) inside mdx, it would automatically create a url to localhost:3000/en/home if you were on the English version, and localhost:3000/de/home, if you were on the German version.

In v3

  • We don't have the same i18n capability, but workaround it with optional middleware.
  • If you don't have this middleware, you would have to create [Home](/en/home) for the English mdx page and [Home](/de/home) for the German page.
  • When ideally, you'd only want to use the relative path without having to include the locale.

@jonasschultheiss
Copy link
Author

I'm sorry for leaving this hanging.
In my context I export the next app statically to github pages, so the middleware is not an option for me.
I remembered this issue, as I was writing on the documentation, used a link and it worked as expected. I will have to test it again more in depth, but I don't have the time for that right now. I'll try to do it this weekend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants