Closed eeeman1 closed 3 years ago
HttpApi doesn't work server side (I can't see translations on first page load)
https://codesandbox.io/s/smoosh-thunder-o0fuw
just add plugin i18next-http-backend specify url to download translation
const NextI18Next = require('next-i18next').default; import HttpApi from 'i18next-http-backend'; const { localeSubpaths } = require('next/config').default().publicRuntimeConfig; const path = require('path'); module.exports = new NextI18Next({ use: [HttpApi], backend: { loadPath: `https://pobeda37.io/api/gettranslate?lng={{lng}}&ns={{ns}}`, crossDomain: true }, otherLanguages: ['de'], localeSubpaths, localePath: path.resolve('./public/static/locales') });
I expected translations to be loaded in the same way on the server side
This is the documentation repo...
regarding using next-i18next open issues -> https://github.com/isaachinman/next-i18next/
having questions -> stackoverflow
🐛 Bug Report
HttpApi doesn't work server side (I can't see translations on first page load)
To Reproduce
https://codesandbox.io/s/smoosh-thunder-o0fuw
just add plugin i18next-http-backend specify url to download translation
Expected behavior
I expected translations to be loaded in the same way on the server side
Your Environment