react-node-polyglot
Node polyglot react component
Last updated 3 months ago by atomiomi .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install react-node-polyglot 
SYNC missed versions from official npm registry.

React Node Pyloglot Build Status

React component to use node-polyglot

Install

npm install react-node-polyglot

You also need to install peer dependencies by yourself

npm install node-polyglot // v2.x.x
npm install react // v16.x.x
npm install prop-types // v15.x.x

This module targets Node.js 8 or later and the latest version of Chrome, Firefox, and Safari. If you want support for older browsers use Babel compiler.

Usage

const { Provider, withPolyglot, useT, useLocale } = require('react-node-polyglot');


const PolyglotHOC = withPolyglot(({ t, locale }) => {
  // locale object that is passed to provider
  return t('phrase');
});

const PolyglotHook = () => {
  // locale object that is passed to provider
  const locale = useLocale();

  const t = useT();
  return t('phrase');
};

const App = () => (
  <Provider locale={{ dictionary }}>
    <PolyglotHOC />
    <PolyglotHook />
  </Provider>
);

License

MIT © Abylay Keldibek

Current Tags

  • 2.0.5                                ...           latest (3 months ago)

16 Versions

  • 2.0.5                                ...           3 months ago
  • 2.0.4                                ...           5 months ago
  • 2.0.3                                ...           5 months ago
  • 2.0.2                                ...           7 months ago
  • 2.0.1                                ...           8 months ago
  • 2.0.0                                ...           8 months ago
  • 1.0.0                                ...           a year ago
  • 0.2.1                                ...           a year ago
  • 0.2.0                                ...           a year ago
  • 0.1.4                                ...           a year ago
  • 0.1.3                                ...           2 years ago
  • 0.1.2                                ...           2 years ago
  • 0.1.1                                ...           2 years ago
  • 0.1.0                                ...           2 years ago
  • 0.0.1                                ...           2 years ago
  • 0.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 16
Last Day 0
Last Week 16
Last Month 0
Dependencies (1)
Dev Dependencies (8)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |