-
Notifications
You must be signed in to change notification settings - Fork 19
feat(app): add internationalization (i18n) support #70
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
Conversation
|
@BenjaminOddou is attempting to deploy a commit to the Nuxt Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
commit: |
|
Hello @BenjaminOddou, thanks a lot for your PR 🙏 I'm finishing a massive refactor (#91) and I'll then resolve conflicts with your branch to merge it! |
|
@larbish, great news ! Don't hesitate to ping me if there is anything I can do. 😄 |
Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
|
Here is what I've updated:
@farnabaz @atinux Can you see another way instead of |
Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
|
I like using |
atinux
left a comment
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.
Amazing! Au top :)
|
Generally looks good to me 👍 Great work Using UI and Translations are App's responsibility. |
|
We've decided with @farnabaz to remove the translations override and simplify the PR:
@farnabaz Feel free to merge once you've checked option types with build version |

💬 Description
This PR introduces internationalization (i18n) support to the Nuxt Studio editor, allowing the UI to be translated.
It provides a mechanism for users to add their own translations or override the defaults.
💡 Implementation Details
This PR implements a solution by "injecting" the translations at runtime:
Module (
src/module/src/module.ts):defuto merge defaults (src/app/locales), user-defined locales (app/locales/studio),app.configoptions andnuxt.configoptions.virtual:studio-i18n-messages) to provide this merged JSON.studio-i18n-plugin.client.mjs).Nuxt Plugin (
studio-i18n-plugin.client.mjs):virtual:studio-i18n-messagesbecause it runs within the Nuxt project's context.window.__NUXT_STUDIO_I18N_MESSAGES__.Studio App (
src/app):src/app/src/i18n.tsis refactored into a factory function (createStudioI18n) that accepts amessagesobject.src/app/src/main.ts, duringconfigureApp, now reads the messages fromwindow.__NUXT_STUDIO_I18N_MESSAGES__and passes them tocreateStudioI18nto dynamically create the i18n instance.