Closed kruzliak-juraj closed 2 years ago
Hi @kruzliak-juraj, thanks for the report. I reworked this part before publishing 1.9.0, and it should work now.
I tried to be more compliant with Next docs, and the behaviour may surprise you sometimes: if you want the locale in the href to be taken into account, you need to set locale
to false
.
Please reopen the issue if you still have bugs.
Since I can not use 1.8.0 due to this issue I am using the 1.9.0-3
I have this structure:
in routes.json is defined:
The issue
When navigating with
useRouter
orLink
fromnext-translate-routes/link
and trying to navigate to the 'incorrectly' translated path the part of path that should be translated stays the samerouter.push('cz/author/name-of-author', 'cz/author/name-of-author', { locale: 'cz' })
or
<Link href={'cz/author/name-of-author'} locale={ 'cz' } >
Both route to
__domain__/cz/author/name-of-author
instead of__domain__/cz/autori/name-of-author
.Link
also generates the URLs with wrong translation in html.On full reload, the URLs is properly translated.