This package has been deprecated

Author message:

Missing importReactIntl

@vtex/intl-container

3.0.0 • Public • Published

intl-container

A React component for loading i18n translations and intl locale data

Example

import React, { Component } from "react";
import Page from "./Page";
import createIntlContainer from "intl-container";

const IntlContainer = createIntlContainer({
  importIntl: () => import("intl"),
  importIntlLocale: locale => import("intl/locale-data/" + locale),
  importReactIntl: locale => import("react-intl/locale-data/" + locale),
  importCountryCodes: locale =>
    import("i18n-iso-countries/langs/" + locale + ".json"),
  importTranslation: locale => import("./i18n/" + locale)
});

export default class App extends Component {
  render() {
    return (
      <IntlContainer locale={this.props.locale}>
        <Page />
      </IntlContainer>
    );
  }
}

Props

  • locale: The locale to be loaded.
  • loader: An element to use as loader. (Default: <div/>)
  • children: Root component that needs to translate strings.

Package Sidebar

Install

npm i @vtex/intl-container

Weekly Downloads

1

Version

3.0.0

License

MIT

Unpacked Size

11.3 kB

Total Files

5

Last publish

Collaborators

  • breno