-
-
Notifications
You must be signed in to change notification settings - Fork 765
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
Migrate next-i18next to app router i18n has conflicts #2221
Comments
I never tried that, but since the pages setup and the app router setup can coexist (based on Next.js docs), it should work. |
I have the same question as @Hanggi. I have a large application that uses I haven't seen any info or examples on how to do this type of migration. I know that both i18n approaches should not be combined long term, but is it technically possible in the short term while converting one route at a time? |
Good question |
Any luck with this? |
Yes, I got this working:
I also updated the new middleware file that adds the locale if missing in the URL. Original
Updated
|
@arinaldi Did you use i18next alongside, or did you go without a library here? Is there a code example you can share for your solution? |
Yes, I continued to use I did not use a package for new routes in the |
How about interpolation and pluralisation? Did you set up helper functions, or was that not required for you? I was hoping to keep similar syntax for translated text in both the sides - app and page router |
Yes, you'll have to write helper functions if you want parity between the two. Or look into translation packages that support the app router. |
@arinaldi how did you get next-i18next to understand the chosen locale in the pages router? |
I don't undestand. |
@arinaldi when I did the same on pages part of app I'm getting |
The tutorial about apply i18n to app router only shows the new project.
https://locize.com/blog/next-13-app-dir-i18n/
When migrate next-i18next to app router, the approach conflict with existing next-i18next.
Is is possible migrate next-i18next to new app/[lang]/page pattern and support both i18n features?
The text was updated successfully, but these errors were encountered: