-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Refactor i18n Message Loading #15282
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
✅ Deploy Preview for ethereumorg ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
38f6e34
to
515d434
Compare
515d434
to
f3c2588
Compare
@@ -17,7 +17,7 @@ export default getRequestConfig(async ({ requestLocale }) => { | |||
|
|||
const allLocaleMessages = await loadMessages(locale) | |||
const allDefaultMessages = await loadMessages(routing.defaultLocale) | |||
const messages = merge(allDefaultMessages, allLocaleMessages) | |||
const messages = merge({}, allDefaultMessages, allLocaleMessages) |
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.
Avoids mutating the original object. This was creating weird behaviors with how the locales were loaded.
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.
Looks great, and working well on my end. Thanks @pettinarip! pulling in
Description
loadMessages
with Next.js'sgetMessages
fromnext-intl/server
setRequestLocale
calls for proper locale context"src/intl/**/*"
in netlify.toml file because its not detected now that we are usinggetMessages
instead ofloadMessages