0

I'm currently trying to integrate next-i18next and i18next-http-backend into my nextjs project so that localization definitions are loaded from a backend endpoint.

But with the following configuration, no http requests are made to the backend and also no errors are printed to the console.

export default appWithTranslation(App, {
  i18n: {
    defaultLocale: 'en',
    locales: ['en', 'de', 'fr'],
  },
 backend: {
    loadPath: 'http://localhost:5000/api/v2/myproject/translations/{{lng}}/{{ns}}',
    allowMultiLoading: false,
    parse: (data: any) => {
      console.log('parse is called')
      return data
    },
    request: (options, url, payload) => {
      console.log(options, url, payload)
    },
  },
  debug: true,
  serializeConfig: false,
  use: [I18NextHttpBackend],
})

At my nextjs page, I'm also calling serverSideTranslations.

Vetterjack
  • 2,227
  • 4
  • 19
  • 31

1 Answers1

0

I'm suffering the same issue, notice that if you comment out the serverSideTranslations then there will b a network request

  • 1
    As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Aug 07 '22 at 09:06