react-intl-simplelocalize
v1.0.4
Published
>
Downloads
3
Readme
react-intl-simplelocalize
Install
npm install --save react-intl-simplelocalize react-intl
or
yarn add react-intl-simplelocalize react-intl
Configuration
- Setup account here: https://simplelocalize.io
- Create new FormatJS project.
- Copy project hash from settings tabs.
- Wrap your applications same as you do with redux
<Provider/>
.
import SimpleLocalize from 'react-intl-simplelocalize'
const app = document.getElementById("root");
render(
<SimpleLocalize projectToken="<PROJECT_TOKEN>">
<App/>
</SimpleLocalize>, app);
Usage
Start using <FormattedMessage />
components from yahoo/react-intl
.
import React from "react";
import {FormattedMessage} from "react-intl";
class Home extends React.Component {
render() {
return (<FormattedMessage id="hello" />);
}
}
export default Footer;
That's all, all translations will be now loaded and injected automatically.
Adding new i18n keys
Discovering new keys automatically
Consider use of simplelocalize-cli
for the best experience. This application will find and push all new i18n keys in seconds!
Adding new keys manually
You can always manually add new keys using SimpleLocalize cloud.