React Polyglot
Higher order component for using Polyglot.
Installation
npm install --save react-polyglot
Usage
react-polyglot
exports consists for one wrapper component called I18n
, one decorator called
translate
and one hook called useTranslate
. The decorator provides a prop t
which is instance of Polyglot
.
You are required to wrap your root component with I18n
and pass on a locale
like en
or fr
.
And messages
object containing the strings.
Then inside App
or a child component of App
you can do:
or with React Hooks:
How to provide context in your tests
Use a simple helper to wrap your components in a context.
Then use it inside your tests.
Work in progress
Tests and Contributing guides are in progress.