-
-
Notifications
You must be signed in to change notification settings - Fork 206
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
In next version 13.4.0 app directory, next-translate doesn't work #1041
Comments
You need to add |
BTW; contributions in next-translate-plugin are very welcome 😊 |
@lynn1286 |
It does not work with next config for experimental appDir, you can check it out in the original sandbox attached in this issue. |
For me it worked with the |
😫 No |
Does it mean I can't use the Nextjs app directory 🥶 |
Related with this one: aralroca/next-translate-plugin#21 |
Does not work. NextJs 13.4.2 + next-translate@^2.0.5 + next-translate-plugin@^2.0.5 |
I can confirm that generally plugin works with:
configuration for server components. But for client component right now I am stuck with following issue: Could you recommend something here? I am a bit new to Next.js so maybe I should have configured language somehow. |
@superhorsy I also have the problem that |
Just after upgrading next from 13.3.0 to 13.4.4, the next-translate plugin doesn't work anymore. |
Hello @sandrooco , But while I did that I realized that maybe for next-translate to get locale with app router, you need to use [lng] folder as a wrapper of your routes (I didn't do that). Here is official example. I didn't test that but I think it should work with next-translate. |
After some tests, I can confirm that |
@nagman as a workaround you need to add again the |
@aralroca even if I don't use the |
@aralroca Yes but there's not much to say. EDIT: of course, I've restarted next at each change, and I even deleted the |
Try next-translate-plugin 2.3.0-canary.2 prerelease please 🙏 |
@aralroca I just updated it to the canary 2 version, and it still doesn't work:
|
Oh! My bad, it does work! |
@nagman sounds good then 😊 I think currently there is an issue with client components commented here aralroca/next-translate-plugin#22 (comment) but happy that at least now works better than before. |
I don't see any issue with client components (at least with the pages directory - maybe the other thread is talking about the app directory) |
New fixes in next-translate-plugin and next-translate (both with the same version) 2.3.0-canary.3 prerelease. Feedback will be very welcome 🙏😊 |
@aralroca Still got this 404 error with these: Can you please fix this? I need this in a couple of days in production. :) |
Try this @Gyurmatag: "next": "13.4.4",
-"next-translate": "2.0.6",
+"next-translate": "2.3.0-canary.3"",
"next-translate-plugin": "2.3.0-canary.3"
|
@aralroca I tried that. I've got this when npm install:
Also I've got 404 in local and my build fails in production on Vercel... |
@qtnx @Gyurmatag please would be very useful if you provide a repo with this problem to help us to detect what is happening. @Gyurmatag feel free to contribute if you are in a hurry. I'm currently traveling for work and I need to prepare for some talks and is hard for me to take time, I'll try it, but I can't promise you. |
@Gyurmatag I'm using Yarn and haven't encountered that issue.
Great. Thank you. I'm also working around trying to resolve it. If cannot I will give more context. |
|
@Gyurmatag no, some improvements but is not fixing your bug. I investigate it a little bit and looks a bug in Next.js core, because the middleware is not working well and is not related to the next-translate-plugin. Disabling the plugin, the same 404 page is happening: next.config.js // /** @type {import('next').NextConfig} */
// const nextTranslate = require("next-translate-plugin");
// module.exports = nextTranslate({
// experimental: { appDir: true },
// });
module.exports = {
i18n: {
locales: ['en', 'hu'],
defaultLocale: 'hu',
},
experimental: { appDir: true },
} And the example of the middleware is from Next.js docs: https://nextjs.org/docs/app/building-your-application/routing/internationalization Probably we need a better way to handle this inside the middleware |
@Gyurmatag It looks like this. If you are in a hurry, I recommend you to temporarily downgrade Next.js until this bug is fixed. In the example we have in the repo is with version 13.2.0 of Next.js and works fine.
|
In Next.js v13.2.5-canary.7 was working fine, but in 13.2.5-canary.8 stop working. |
I have made a PR to support You can try it with these versions:
Things to keep in mind:
I updated the example of next-translate working with |
both ways now are supported ( |
I have a same problem that fixed it by this way😊. This problem has been troubling me for an entire night😭. |
What version of this package are you using?
iShot_2023-05-07_18.02.30.mp4
What happened?
The latest version of NextJs, international routing 404 💔
codesandbox code
https://codesandbox.io/p/sandbox/next-translate-app-dir-forked-vp5r4n?file=%2FREADME.md
What did you expect to happen?
hope to get help ,Thanks 🫡
The text was updated successfully, but these errors were encountered: