Questions tagged [next-i18next]
165 questions
0
votes
0 answers
next-i18next switching to default locale after refresh
Hello I have a problem with next-i18next in NextJS. When I switch to cs locale and refresh the page the page switch locale back to en. I have Chrome default language set to English though. But shouldnt it works just fine when I want to browse the…

Richard Biroš
- 31
- 7
0
votes
2 answers
next-i18next: update changes without restarting server on dev and production both
I'm using Next.js and with the following config.
module.exports = {
debug: true,
backend: {
backends: [HttpBackend],
backendOptions: [
// { expirationTime: 60 * 60 * 1000 },
{
loadPath:…

Swapnil Soni
- 965
- 1
- 10
- 26
0
votes
1 answer
How fix language change issues in production when no error in console using next-i18next?
my changeLanguage function is not working in production. Using the debug functionality of i18n i do not have any warning, more so the language change is detected correctly each time i click on the select menu.
i have log locale on the console and it…

Leo
- 481
- 2
- 9
- 20
0
votes
1 answer
Error when adding serverside translations to my next.js app
I am getting an error when deploying my app to vercel, but my app work perfectly fine on local server.
Here is what my function logs looks like
TypeError: Cannot read properties of undefined (reading '__NEXT_DATA__')
at Document…

Ahmed Elhoseny
- 77
- 5
0
votes
0 answers
next-i18next: Fetch data from HTTP api call and apply to resource
I'm trying to do i18n translation using next-i18next in Next.js
My current code in
_app.ts
export default appWithTranslation(MyApp);
export const getStaticProps = async () => {
const res = await api.get('/translation');
const name =…

Swapnil Soni
- 965
- 1
- 10
- 26
0
votes
1 answer
Excessive use of useTranslation() hook
I'm using next-i18next to translate my Next.js pages. I'm wondering if using
const { t } = useTranslation('common') everywhere for each react component would have a negative impact on performance. The alternative would be calling it in the parent…

aryankarim
- 184
- 1
- 10
0
votes
2 answers
How to redirect to home page from custom 404 page with locale in the url nextjs
I want to redirect from a custom 404 page to the home page with locale in the URL.
E.g: if the users type wrong URL localhost:3000/ja/news/wrong-uri user will be redirected to localhost:3000/ja/.
The problem is when nextjs redirect to custom a…

Sơn Nguyễn
- 21
- 4
0
votes
0 answers
next_i18_next undefined when i naviagate to another route
I m working on a project with nextjs and I use the next_i18_next library for localization, I m getting an undefined error when I try to navigate to another route.
Cannot read properties of undefined (reading '_nextI18Next')
at AppWithTranslation…

reza47
- 650
- 6
- 16
0
votes
1 answer
next-i18next i18n on array of objects
I have an array of objects called "Options", that I use as a prop to a dropdown/select Material-UI component. I want to use the next-i18next library on the labels. I already implemented with success through all the next app just like the…

Raissa Correia
- 169
- 4
- 18
0
votes
1 answer
Next-i18Next Blocking Global State in NextJS
I am using RecoilJS to pass global state between two pages in Next. This works fine, until I use next-i18next in the page receiving the variables. If I comment out the next-i18next code in the getServerSideProps of the receiving page, the Recoil…

Ray Purchase
- 681
- 1
- 11
- 37
0
votes
1 answer
Load i18n resources in next-i18next from api endpoints no http request is fired
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…

Vetterjack
- 2,227
- 4
- 19
- 31
0
votes
0 answers
Fetch API cannot load webpack-internal:///./node_modules/next-i18next/dist/esm/appWithTranslation.js. URL scheme "webpack-internal" is not supported
After installing next-i18next I keep getting this error even in pages where I am not using it. I'm not sure how to fix it. Thankfully it isn't breaking anything but this is my next-i18next.config.js
module.exports = {
i18n: {
locales: ['en',…

Kristian Martinez
- 142
- 2
- 12
0
votes
1 answer
Can you use a redux store as the translation resources in next-i18next?
I have a website set up with contentEditable text, that's text content a user can edit, and I need to set up translations so that when the user edits this text, it's updated in the translations.json file. I set up a redux store with actions that…

Ibrahim El-bana
- 1
- 1
0
votes
1 answer
i18next dosen't change language at nextjs app
I'm trying to use i18next for localtization, it works well as it translates english text to arabic {t("title")} ==> مرحبا.
But when i try to change language to english with
const { t, i18n } = useTranslation()
i18n.changeLanguage('en')
it dosen't…

Abdelrhman Gad
- 195
- 2
- 11
0
votes
1 answer
next-i18next re-rendering _app.js after page load with getstaticprops
I'm using next-i18next and the app.
the _app.js is called again after every getstaticprops function.
Why is that?
Thank you

Avichay Dahan
- 79
- 1
- 4