react-translator
v0.0.5
Published
For super simple i18n in React.
Downloads
10
Readme
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);