react-translator

0.0.5 • Public • Published

For super simple i18n in React.

Set some strings globally:

Translator = require('react-translator');
React = require('react');
 
Translator.setStrings({
  home: {title: 'Welcome'}
});
 
React.renderComponent(Translator({tag: 'h1'}, 'home.title'), container);

Or pass in some strings as a prop to override the global ones:

React.renderComponent(Translator({strings: {hello: 'Hi'}}, 'hello'), container);

Dependencies (0)

    Dev Dependencies (1)

    Package Sidebar

    Install

    npm i react-translator

    Weekly Downloads

    10

    Version

    0.0.5

    License

    none

    Last publish

    Collaborators

    • brian-c