Runtime catalog loader. Compiled id → string catalogs live in ./compiled/
(generated by npm run i18n via the FormatJS CLI) and are bundled eagerly by
Vite so a locale switch is synchronous with no network round-trip.
The source locale (en) intentionally has no catalog: every message keeps
its inline defaultMessage, so react-intl renders English straight from the
components. Only non-source locales need a catalog.
- Description:
Runtime catalog loader. Compiled
id → stringcatalogs live in./compiled/(generated bynpm run i18nvia the FormatJS CLI) and are bundled eagerly by Vite so a locale switch is synchronous with no network round-trip.The source locale (
en) intentionally has no catalog: every message keeps its inlinedefaultMessage, so react-intl renders English straight from the components. Only non-source locales need a catalog.
- Source:
Methods
(static) messagesFor(locale) → {Object.<string, string>|undefined}
- Description:
Messages for a locale, suitable for
<IntlProvider messages>.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
locale |
string | A resolved, supported locale code. |
Returns:
The catalog, or undefined for
the source locale (react-intl then uses each message's defaultMessage).
- Type
- Object.<string, string> | undefined