You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am currently using Next.js with the next-intl library for handling internationalization (i18n) in my application. I need to deploy my frontend Next.js application to a Laravel public folder, and I would like to export the translation functions and messages as static files.
Current Status
As of now, it seems that the built-in internationalization support in Next.js does not fully integrate with the static export feature, particularly when using the App Router. This limitation makes it challenging to export translations generated by next-intl to static files for deployment.
Questions
Is there a current method to export translations from next-intl to static files when using the App Router?
Are there any planned updates or features in Next.js that would support this functionality in the future?
What are the recommended workarounds or solutions at this stage for exporting the translation function to static files?
Possible Solutions
I am considering the following approaches and would appreciate any insights or recommendations:
Using a custom script to extract translation strings and save them as JSON files during the build process.
Reverting to the Pages Router with next-export-i18n to facilitate static exports and localization.
Your feedback and guidance on this matter would be greatly appreciated. Thank you for your assistance!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Description
I am currently using Next.js with the next-intl library for handling internationalization (i18n) in my application. I need to deploy my frontend Next.js application to a Laravel public folder, and I would like to export the translation functions and messages as static files.
Current Status
As of now, it seems that the built-in internationalization support in Next.js does not fully integrate with the static export feature, particularly when using the App Router. This limitation makes it challenging to export translations generated by next-intl to static files for deployment.
Questions
Is there a current method to export translations from next-intl to static files when using the App Router?
Are there any planned updates or features in Next.js that would support this functionality in the future?
What are the recommended workarounds or solutions at this stage for exporting the translation function to static files?
Possible Solutions
I am considering the following approaches and would appreciate any insights or recommendations:
Your feedback and guidance on this matter would be greatly appreciated. Thank you for your assistance!
Beta Was this translation helpful? Give feedback.
All reactions