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
.