Next Intl Messages and Formatting
Pack:
next-intlSource:next-intl/next-intl-messages-and-formatting/SKILL.mdUse this skill when the task is about message authoring, translation consumption, or locale-aware formatting behavior.
- message catalog structure and namespace strategy
- ICU authoring patterns
useTranslations,t.rich,t.markup,t.raw,t.hasuseFormatterand named formats- typed ICU arguments and message validation
useExtractedas an optional workflow
Routing cues
Section titled “Routing cues”- message JSON structure, namespace design, ICU, rich text, formatting, validation -> use this skill
defineRouting, locale switchers, domains, pathnames -> usenext-intl-routing-and-navigationgetTranslationsin metadata,setRequestLocale, testing, error files -> usenext-intl-server-runtime- plugin flags, TypeScript augmentation, Crowdin, loading strategy -> use
next-intl-workflows-and-tooling
Default path
Section titled “Default path”- Read references/icu-rich-text-and-catalogs.md first.
- If the task touches formats, validation, or extracted messages, read references/formatting-validation-and-types.md.
- Keep namespaces close to the component boundary and choose the lowest stable common branch.
- Move language logic into ICU messages instead of branching in application code.
When to deviate
Section titled “When to deviate”- Use server-side translation APIs only for the documented server exceptions.
- Reach for
t.markuponly when the output must stay string-based rather than React-node based. - Treat
useExtractedas opt-in workflow tooling, not the baseline message authoring model.
Guardrails
Section titled “Guardrails”- Keep catalogs as nested objects. Do not use
.inside message keys. - Prefer consuming translations from components. Use server awaitables only for the official server-side exceptions.
- Do not call
useTranslationsoruseFormatterinasynccomponents. - Use
t.rich(...)for translatable markup. Avoid surrounding sentence fragments with hardcoded JSX. - Use
t.markup(...)when tags should compile to strings, not React nodes. - Use
format.list(...)for locale-aware lists instead of joining strings manually. - Treat
useExtractedas experimental, not as the default baseline.
- putting
.inside message keys - calling translation hooks inside
asynccomponents - branching language logic in app code when ICU can own it
- treating experimental extraction as the default message path
Verification checklist
Section titled “Verification checklist”- namespaces are stable and close to the component boundary
- ICU handles language branching where appropriate
- the chosen formatting API matches the output type needed
- server exceptions are handled with the correct server-side APIs
- message authoring stays compatible with validation and typing strategy
Canonical APIs
Section titled “Canonical APIs”useTranslationsuseFormattert.richt.markupt.rawt.has
Maintenance
Section titled “Maintenance”- Snapshot date: 2026-03-10
- Package snapshot:
next-intl@4.8.3published 2026-02-16