Skip to content

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

Merged
merged 3 commits into from
Apr 15, 2025
Merged

Refactor i18n Message Loading #15282

merged 3 commits into from
Apr 15, 2025

Conversation

pettinarip
Copy link
Member

@pettinarip pettinarip commented Apr 14, 2025

Description

  • Ensured proper merging of locale messages
  • Replaced custom loadMessages with Next.js's getMessages from next-intl/server
  • Added setRequestLocale calls for proper locale context
  • Forced inclusion of "src/intl/**/*" in netlify.toml file because its not detected now that we are using getMessages instead of loadMessages

Copy link

netlify bot commented Apr 14, 2025

Deploy Preview for ethereumorg ready!

Name Link
🔨 Latest commit 712c67c
🔍 Latest deploy log https://app.netlify.com/sites/ethereumorg/deploys/67fe44695fb7ed0008886178
😎 Deploy Preview https://deploy-preview-15282--ethereumorg.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
7 paths audited
Performance: 46 (🔴 down 18 from production)
Accessibility: 95 (🟢 up 1 from production)
Best Practices: 91 (🔴 down 7 from production)
SEO: 98 (no change from production)
PWA: 59 (🟢 up 18 from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@pettinarip pettinarip changed the title Fix load messages2 Fix load messages Apr 14, 2025
@pettinarip pettinarip marked this pull request as ready for review April 14, 2025 19:40
@pettinarip pettinarip force-pushed the fix-load-messages-2 branch from 38f6e34 to 515d434 Compare April 14, 2025 19:42
@pettinarip pettinarip force-pushed the fix-load-messages-2 branch from 515d434 to f3c2588 Compare April 15, 2025 08:59
@github-actions github-actions bot added the config ⚙️ Changes to configuration files label Apr 15, 2025
@pettinarip pettinarip changed the title Fix load messages Refactor i18n Message Loading Apr 15, 2025
@@ -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)
Copy link
Member Author

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.

Copy link
Member

@wackerow wackerow left a 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

@wackerow wackerow merged commit c741514 into dev Apr 15, 2025
6 checks passed
@wackerow wackerow deleted the fix-load-messages-2 branch April 15, 2025 14:20
This was referenced Apr 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
config ⚙️ Changes to configuration files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants