Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@vtex/intl-container

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vtex/intl-container

A React component for loading i18n translations and intl locale data

latest
Source
npmnpm
Version
3.0.0
Version published
Maintainers
1
Created
Source

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.

Keywords

react

FAQs

Package last updated on 14 Feb 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts