@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

Readme

Keywords

Package Sidebar

Install

npm i @sideroad/react-i18n

Weekly Downloads

285

Version

4.0.0

License

MIT

Unpacked Size

9.21 kB

Total Files

7

Last publish

Collaborators

  • sideroad