Questions tagged [next-i18next]
165 questions
21
votes
5 answers
next-i18next Jest Testing with useTranslation
Testing libs...always fun. I am using next-i18next within my NextJS project. We are using the useTranslation hook with namespaces.
When I run my test there is a warning:
console.warn
react-i18next:: You will need to pass in an i18next instance by…

Phil Lucks
- 2,704
- 6
- 31
- 57
11
votes
2 answers
How to add next-i18next translation on a dynamically routed page in a nextjs application?
I have a dynamically routed page in Nextjs (v10.1.3) /my-translation/[id], I'd like to use next-i18next (v8.1.3) package to translate this page.
I tried using 2 folder structure in Nextjs, they both give the same error that I can not…

meightythree
- 308
- 2
- 16
9
votes
6 answers
Next-i18next Initial locale argument was not passed into serverSideTranslations
It works locally.
However, it will make nextServer 500 internal error once I deployed it on firebase.
next-i18next version
8.1.3
Config
module.exports = {
i18n: {
defaultLocale: 'en',
locales: ['en', 'ko'],
},
};
Codes
_app.tsx
import {…

Jason Mendoza
- 91
- 1
- 1
- 3
7
votes
1 answer
How can I localize routes with the nextJs and next-i18next like an URL alias?
I'm using NextJs 10.0.5 with next-i18next 8.1.0 to localize my application. As we all know nextJs 10 has subpath routing for internationalized routing. In addition, I need to change the page names by language. For example, I have a contact-us file…

ofsahinler
- 71
- 1
- 3
7
votes
1 answer
Next.js with i18n error : Warning: Text content did not match. Server: "" Client: "fr"
We get this error on load.
Application first loads at URL http://localhost:3000/ then when we switch to ex: french we get http://localhost:3000/fr but when we switch languages again to ex: deutsch we get http://localhost:3000/de/fr and so on. The…

spookSpookyActionAtADistance
- 71
- 1
- 3
6
votes
1 answer
NextJS 13 - How to create a multilingual not-found page using route groups
I'm struggling to get the localized not-found page to work with NextJS 13 (app-dir). I'm following the official guide on internationalization, as well as this solution I have found on GitHub.
The first solution I have tried
[locale]
--…

Fabio Nettis
- 1,150
- 6
- 18
6
votes
1 answer
next-i18next translation not working in storybook, console logs missingKey
I am setting up storybook and for my translations I am using next-i18next. This is How I set it up:
// .storybook/i18n.js
import i18n from 'i18next';
import { initReactI18next } from 'react-i18next';
i18n.use(initReactI18next).init({
fallbackLng:…

Mähnenwolf
- 720
- 10
- 30
6
votes
0 answers
Is there a way to use next-i18next without Next.js internationalized routing?
I'm using next-i18next package in couple of projects already and it works great.
In my current project I need to integrate i18n, but this time only with cookie support, without internationalized routing and I wonder if I can achieve that with this…

kachar
- 2,310
- 30
- 32
5
votes
3 answers
proper getServerSideProps syntax for Typescript next.js + i18n
I'm struggling with next-i18next integration in a NextJS Typescript project - has nearly no recent examples anywhere. I've already configured internationalized routing, but I can't properly setup i18next as long as getServerSideProps syntax is…

Horkos
- 227
- 2
- 5
- 12
5
votes
2 answers
Can not use serverSideTranslations on Vercel
In my index page i'm using serverSideTranslations function. getting error about finding file of translation.
this error happens only on pages that used by serverSideTranslations.
I deployed to Vercel and Netlify. in both of them i'v got the same…

Nadav Avisror
- 153
- 1
- 8
5
votes
1 answer
React components in i18next interpolation display as [object Object]
My React app uses next-i18next package. I'd like to put some React component inside my interpolation:
import React from 'react';
import { useTranslation } from 'next-i18next';
import { serverSideTranslations } from…

Robo Robok
- 21,132
- 17
- 68
- 126
5
votes
0 answers
How to implement i18n localization in next for static site generated (SSG) pages
I have implemented two different third party packages to achieve localization for static site generated (SSG) pages, which includes next-i18next and next-translate. Both of them are working fine for server rendered and client side rendered pages. I…

fazlu
- 856
- 5
- 10
4
votes
1 answer
Is it possible to use the layout in the _app.jsx component with next-i18next?
To create a site, I use nextjs, when creating pages, I took the general layout with the header and footer into a separate hoc component and wrapped the page components in the file with it _app.jsx:
function App({ Component, ...rest }) {
const {…

UKRman
- 404
- 3
- 16
4
votes
2 answers
Bug with next-i18next and deployment on vercel (recently)
Update 2:
This probably has to do with the this PR where assets have been removed as dependency.
Update 1:
Managed to get a reverse shell into the serverless function and it really would appear that there is no public folder anymore:
Provide…

Fabian Bosler
- 2,310
- 2
- 29
- 49
4
votes
0 answers
Load different css file based on Next JS internationalized Routing
I have two different CSS files. One for English and One for Arabic. I am using next-i18next for internationalized routing in my next js App.
What I want is to load the CSS files based on the route. I have managed to make it work in my local system…

Life Smile
- 53
- 1
- 4