-
Notifications
You must be signed in to change notification settings - Fork 30
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
Incorrect translation of external links #55
Comments
Yes, it should not. Seems like a bug the tests did not catch. |
Hey guys ! We have some similar issues with our project.
We pass this url as We use the tips from @simonhenke for prevent this problem and it's working well. Thanks in advance ! |
Until now, next-translate-routes tries to match any url pathname with a local page. If it fails to do so, it returns use the raw url as is. The problem is that an external url pathname can match a local page, especially if you use match all pages. So we need to add a domain check, but it is not that easy because there could be several local domain depending on the locale. So we need to fix this issue first. |
Thanks @cvolant for the answer. |
Some version between 1.8.0-1 and 1.9.1 now causes external links to be translated incorrectly:
I'm passing a href like
https://www.dhl.com/de-de/home/tracking/tracking-express.html
and the lib parses it to
/de-de/home/tracking/tracking-express.html
My current workaround is something like
const Link = href.toString().startsWith("http") ? NextLink : NextTranslateRoutesLink;
which I then render in a custom component.
But it would be better if the next-translate-routes wouldn't translate external links.
The text was updated successfully, but these errors were encountered: