next-intl-setRequestLocale-ssg-fix

Fix for next-intl v4 SSG pages showing wrong locale (typically English fallback) despite correct build output. Use when: (1) next-intl pages build successfully with generateStaticParams but render the default locale instead of the expected one, (2) page metadata (from getTranslations with explicit locale) shows correct locale but client components show wrong locale, (3) getMessages() returns default locale messages in [locale] layout/pages. Root cause: missing setRequestLocale() call before getMessages() in server components with static generation.

hubeiqiao Updated

File contents

hubeiqiao/skills/tree/main/next-intl-setRequestLocale-ssg-fix commit 7c2cf6c3d1

Frequently asked questions

npx skillmds@latest add hubeiqiao/next-intl-setrequestlocale-ssg-fix