Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vtex/intl-container
A React component for loading i18n translations and intl locale data
https://github.com/vtex/intl-container
srv-checkout-ui xp-shopping
Last synced: about 1 month ago
JSON representation
A React component for loading i18n translations and intl locale data
- Host: GitHub
- URL: https://github.com/vtex/intl-container
- Owner: vtex
- Created: 2017-12-12T21:39:21.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-07-18T20:58:02.000Z (over 1 year ago)
- Last Synced: 2024-09-20T09:22:34.599Z (3 months ago)
- Topics: srv-checkout-ui, xp-shopping
- Language: JavaScript
- Size: 988 KB
- Stars: 3
- Watchers: 112
- Forks: 2
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# intl-container
> A React component for loading i18n translations and intl locale data
## Example
```js
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 (
);
}
}
```## Props
* **locale:** The locale to be loaded.
`)
* **loader:** An element to use as loader. (Default: `
* **children:** Root component that needs to translate strings.