1

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?

Alex T
  • 3,529
  • 12
  • 56
  • 105
  • Why not using locize instead? Locize is created by the creators of i18next. With using locize you support also the future of i18next. – adrai Jul 22 '22 at 07:41
  • 1
    Hey. Jan from Tolgee here. The next-i18next integration is not trivial for us to support. Have you tried to use Tolgee's own next.js integration? https://tolgee.io/integrations/next – Jan Cizmar Jul 26 '22 at 11:17

0 Answers0