next-intl-messages-and-formatting
Next Intl Messages and Formatting
Use this skill when the task is about message authoring, translation consumption, or locale-aware formatting behavior.
Scope
- 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
- 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
Workflow
- 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.
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.
Canonical APIs
useTranslationsuseFormattert.richt.markupt.rawt.has
Maintenance
- Snapshot date: 2026-03-10
- Package snapshot:
next-intl@4.8.3published 2026-02-16
References
More from dobroslavradosavljevic/skills
base-ui-typescript-surface
Use for Base UI namespace contracts, change event types, generic render types, and wrapper typing patterns.
4base-ui-basic-primitives
Use for simple primitives with low integration complexity (Avatar, Button, Meter, Progress, Scroll Area, Separator).
4base-ui-root-providers
Use for CSP Provider, Direction Provider, and useDirection when wiring Base UI at the app root or across portals.
4base-ui-menus-navigation-and-toast
Use for Menu, Context Menu, Menubar, Navigation Menu, Toolbar, Toast, and shared command-surface patterns such as detached triggers and menu payloads.
4base-ui-forms-and-validation
Use for Base UI Field/Form primitives, validation flows, form controls, and advanced Number Field, Slider, and RadioGroup behavior.
4base-ui-disclosure-and-tabs
Use for stateful visibility components (Accordion, Collapsible) and tab navigation semantics.
4