Installation (i18next)
To install Tolgee i18next integration library run:
- npm
- yarn
npm install i18next @tolgee/i18next
yarn add i18next @tolgee/i18next
Then wrap your i18next instance withTolgee
:
import i18n from 'i18next';
import { withTolgee } from '@tolgee/i18next';
withTolgee(i18n, {
apiUrl: ...,
apiKey: ...,
...
})
.use(...)
.init(...)
Now you can use regular i18next translation features.
Language detection/changes
Tolgee will follow i18next configuration, so you can use i18next language detectors or set the language manually.
To change language use i18next.changeLanguage
function.