-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
Support App Router & Pages Router #22
Conversation
Just a notice, this is incomplete yet. I'm going to be working on it later today. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution. Keep waiting for the final changes
750ab55
to
c5c7c49
Compare
Some updates:
Sub-path routingProviding more context, in Next 12, when defining i18n options in
For Next 13, users would need to create Domain routingI think domain routing should be possible to define inside |
@@ -0,0 +1,10 @@ | |||
import webpack from 'webpack' | |||
|
|||
describe('nextTranslate', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
Yes, the first approach was only for Related with #7 |
Added a todo list at the top to keep track of the progress 🎉 |
24abf2f
to
5d17fab
Compare
The idea with I'm doing this as first step to support translation in layout, error & loading pages. |
I'm kinda stuck with a weird behavior in layout/loading/error components. Inside a server layout component the Funny part is that server pages work correctly even though they are being treated exactly the same by the loader (perhaps that's the problem). I'm going to be full focused on this PR all day tomorrow. Looking forward to finish it. |
Oh, okay. I will fix it. |
Guys, sorry for the delay. I have only a limited time to work on this PR. This feature is trickier than it looked like, but I'm working on it as much as I can. I've tried a few things but still haven't come up to a reliable implementation for i18n in layouts, loading & error. |
@alvesvin Don't be afraid to make several PR, I think it would be easier to review. Feels free to remove the part of layout, loading, error and add it in another PR. |
Hey, @aralroca I'm sorry to say that I think I'm not going to be able to accomplish this PR 😞. Since I use this library in production, I was hoping to try and fix it as it's currently not compatible with Next 13 features. Problem is I think I'm not doing a good job. The last commits is an implementation that feels kinda hacky, bloated and bug-prone. I've tried a few things but I don't have the rationale why the code is the way it is today and what should be done to productively improve it or what should be rethought. I think I started it wrong, maybe not asking the right questions. If you could shed some light on what you think the solution would be, I'm still willing to implement it. Sorry to make you all wait for nothing 🌵 |
@alvesvin Don't worry, your contribution has already been important. As soon as I have some time I will try to implement it and I will take into account all your work on this PR. Thank you very much for your contribution 😊 |
Brilliant work on this one folks. I was wondering if you have a sort of deadline for the next release. This issues is time sensitive for my project . thank you 🎖️ |
@AndresDevelop @alvesvin Try next-translate-plugin 2.3.0-canary.1 prerelease please 🙏 |
Hey @aralroca Using the canary version gives me this error:
|
Next 13.4.4, along with next-translate 2.0.6. Forgot to mention that I had no pages/ directory, creating one fixed that issue but raised a new one:
|
Well, after completely restarting the project, it seems to work. However, certain translations get loaded and replaced by their keys quickly after, giving a bunch of error tied to server/client mismatch. I will investigate the issue, might be related to my implementation as it impacts only my navbar |
@aralroca the issue seems to impact client components only. |
The issue with pages folder is gone, but client components still don't load translations |
Thanks for your feedback @izoukhai. I'm going to investigate the client components what change in the last versions of Next.js. |
@izoukhai is possible to create a repo that reproduces this issue to help me to fix it? Thanks! |
Yup I will give you the repo in a minute! |
Thanks @izoukhai |
@izoukhai thanks for sharing, should be fixed in |
Done in 2.3 |
What is the purpose of this pull request? (put an "X" next to item)
[ ] Documentation update
[x] Bug fix
[ ] New feature
[ ] Other, please explain:
What changes did you make? (Give an overview)
The webpack loader selects the correct helpers on a page by page basis rather than
experimental.appDir
config.Which issue (if any) does this pull request address?
#21 #7 #23
Is there anything you'd like reviewers to focus on?
Perhaps readability and size