Locales are not loaded if Shallow Routing
See original GitHub issueHi,
In order to change the location and maintain the app state and the current path (Change language while staying on the same route). I ran into this issue: next Router changes the local, but next-translate remains in the current language.
<Link href={router.asPath} locale={lng} key={lng} shallow={true}>...</Link>
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Locales are not loaded if Shallow Routing · Issue #518 - GitHub
Hi, In order to change the location and maintain the app state and the current path (Change language while staying on the same...
Read more >Advanced Features: Internationalized Routing - Next.js
Next.js has built-in support for internationalized (i18n) routing since v10.0.0 . You can provide a list of locales, the default locale, and domain-specific ......
Read more >Rails routes with scope ":locale" and shallow nested resources
Ah, yes! I found the answer in the API documentation. The magic is in the :shallow_path keyword and in the above example it...
Read more >Why is shallow routing to a different route not allowed? : r/nextjs
Shallow routing doesnt hit getStaticProps/ initalProps so it wouldn't be to load the page.
Read more >Client-Side Routing In Next.js - Smashing Magazine
You need to have a working knowledge of React and Next.js to get the ... reside in the pages directory but do not...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I don’t know if there is a way to know if the current navigation comes from shallow routing, if so, maybe we could force the
I18nProvider
to download the necessary page translations inside auseEffect
, so you don’t have to use the above workaround…also Next can now identify if the route change is using shallow Update: I tried implementing shallow support in the provider, but for some reason the router object is not being updated #917
https://github.com/vercel/next.js/pull/19802 https://nextjs.org/docs/api-reference/next/router#routerevents