Using tolgee with next-i18next

284 Views Asked by At

I have created Next.js app which uses next-18next library for managing translations in app. Now I wanted to connect it to tolgee platform so that I can leverage its in-context editing feature. I read the docuentation and it only shows how to integrate react-i18next and i18next libraries. So I have been trying to set it similarly in my app and I placed the following code in index.tsx file in my pages folder.

import { withTolgee } from '@tolgee/i18next';
import i18n from 'i18next';
import { UI } from '@tolgee/ui';

withTolgee(i18n, {
    apiUrl: process.env.REACT_APP_TOLGEE_API_URL,
    apiKey: process.env.REACT_APP_TOLGEE_API_KEY,
    ui: UI
}).init({
    supportedLngs: ['en', 'de'],
    fallbackLng: 'en'
});

This is based on the documentation available here: https://tolgee.io/blog/super-fast-react-localization-i18n-with-i18next-and-tolgee

However so far it does not seem to be working at all. How can I integrate tolgee with next-i18next translation library on Next.js app?

0

There are 0 best solutions below