react-intl-simplelocalize

1.0.4 • Public • Published

react-intl-simplelocalize

NPM JavaScript Style Guide

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.

License

MIT ©

/react-intl-simplelocalize/

    Package Sidebar

    Install

    npm i react-intl-simplelocalize

    Weekly Downloads

    0

    Version

    1.0.4

    License

    MIT

    Unpacked Size

    17.3 kB

    Total Files

    6

    Last publish

    Collaborators

    • jpomykala