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);

    Keywords

    none

    Install

    npm i react-translator

    DownloadsWeekly Downloads

    0

    Version

    0.0.5

    License

    none

    Last publish

    Collaborators

    • brian-c