@sideroad/react-i18n

4.0.0 • Public • Published

How to use in next.js 10?

Initialize i18n

_app.tsx

import { init, Provider } from '@sideroad/react-i18n';

...

render() {
  const i18n = init({
    lang: this.props.router.locale,
    locales,
  });

  return (
    <Provider value={i18n}>
      ...
    </Provider>
  );
}

Usage

import I18n from '@sideroad/react-i18n';

const Component = () => <I18n id="hello" />;

LICENSE

MIT

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
4.0.01latest

Version History

VersionDownloads (Last 7 Days)Published
4.0.01
3.0.10
2.2.40
2.2.3287
2.2.20
2.0.20
2.0.11
2.0.00
1.0.321
1.0.300
1.0.290
1.0.270

Package Sidebar

Install

npm i @sideroad/react-i18n

Weekly Downloads

290

Version

4.0.0

License

MIT

Unpacked Size

9.21 kB

Total Files

7

Last publish

Collaborators

  • sideroad