react-intl
Version:
Internationalize React apps. This library provides React components and an API to format dates, numbers, and strings, including pluralization and handling translations.
27 lines (26 loc) • 1.92 kB
JavaScript
import { createFormattedComponent, createFormattedDateTimePartsComponent, } from './src/components/createFormattedComponent.js';
import { createIntl } from './src/components/createIntl.js';
import FormattedDateTimeRange from './src/components/dateTimeRange.js';
import injectIntl, { Context as IntlContext, Provider as RawIntlProvider, } from './src/components/injectIntl.js';
import FormattedMessage from './src/components/message.js';
import FormattedPlural from './src/components/plural.js';
import IntlProvider from './src/components/provider.js';
import FormattedRelativeTime from './src/components/relative.js';
import useIntl from './src/components/useIntl.js';
export { createIntlCache, InvalidConfigError, MessageFormatError, MissingDataError, MissingTranslationError, IntlError as ReactIntlError, IntlErrorCode as ReactIntlErrorCode, UnsupportedFormatterError, } from '@formatjs/intl';
export { createIntl, FormattedDateTimeRange, FormattedMessage, FormattedPlural, FormattedRelativeTime, injectIntl, IntlContext, IntlProvider, RawIntlProvider, useIntl, };
export function defineMessages(msgs) {
return msgs;
}
export function defineMessage(msg) {
return msg;
}
// IMPORTANT: Explicit here to prevent api-extractor from outputing `import('./src/types').CustomFormatConfig`
export var FormattedDate = createFormattedComponent('formatDate');
export var FormattedTime = createFormattedComponent('formatTime');
export var FormattedNumber = createFormattedComponent('formatNumber');
export var FormattedList = createFormattedComponent('formatList');
export var FormattedDisplayName = createFormattedComponent('formatDisplayName');
export var FormattedDateParts = createFormattedDateTimePartsComponent('formatDate');
export var FormattedTimeParts = createFormattedDateTimePartsComponent('formatTime');
export { FormattedListParts, FormattedNumberParts, } from './src/components/createFormattedComponent.js';