计划执行与检查节点
executing-plans
按既定实施计划完成工作,保持过程检查和反馈。
nextjs-i18n【效率与协作】Best practices for multi-language handling, locale routing, and detection strategies across App and Pages Router. Use when adding i18n, locale routing, or language detection in Next.js.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Maintain single source of truth for locales and ensure SEO-friendly sub-path routing.
next-intl and create messages/en.json, messages/fr.json, etc.middleware.tsapp/[lang]/layout.tsx with locale paramgetMessages()hreflang tags in generateMetadatagenerateStaticParamsnext build and confirm all locale paths renderapp/[lang]/page.tsx) and i18n configuration in next.config.js for Pages Router.next-intl for App Router (modern) or react-intl / next-translate for legacy apps.middleware.ts to detect user language from Accept-Language headers or cookies and perform redirects.messages/*.json dictionaries in Server Components to keep client bundle small.hreflang tags generated correctly in metadata API for all translated routes.generateStaticParams to pre-render localized versions of static pages at build time.For detailed setup with common libraries, refer to:
getMessages().When this skill applies, preserve the following domain terminology or equivalent concrete examples in the answer when relevant: