Questions tagged [next-i18next]

165 questions
1
vote
1 answer

NextJS: context is reset when routing when using Next-i18next

I create a Theme context for my nextjs app. This is _app.tsx: function App({ Component, pageProps }: AppProps) { return (
kan
  • 73
  • 6
1
vote
1 answer

NextJS+NextI18Next hydration error when trying to map through array: "Text content does not match server-rendered HTML"

I have a Next JS app with Next-i18next localization and SSR. It works fine in all cases except in one case where I have a custom carousel component on a page that takes in an array of objects as a prop and maps through said array to create the…
1
vote
0 answers

How to apply locale routing only for specific page while using next-i18next translation

I have 4 pages in nextjs project as index, service, contact-us, disclaimer. So I want next-i18next translation system only in index and service not in contact-us and disclaimer page. I made this translation work but still i found locale routing as…
1
vote
1 answer

Next.js and i18next - two variables in single translation - instead of Link I get [object Object]

I have a Footer component: export default function Footer() { const { t } = useTranslation("layout-footer"); const currentYear = new Date().getFullYear(); return (
1
vote
0 answers

React i18next produces "text content doesn't match server-rendered html" error

I'm trying to properly implement i18next for my react project. But since I'm using the translations in my components, I get the error: text content does not match server-rendered html. In general everything works finde and I get the correct…
TGDev
  • 33
  • 4
1
vote
0 answers

How to create shared language resources with i18next in multi-app node/express & react monorepo?

I just started to use i18next in my monorepo (new to it), which has several serverside microservices and a couple of frontends, including several custom library components. Many of the language strings are shared, and some are app specific. I could…
1
vote
0 answers

NextJS ServerSideProps translation don't work properly in dynamic routes

Hi everyone I have a NextJS app ( main host ) inside a NX Project. I have the need to translate the pages inside the app, and i'm using next-i18next package installed. I have several dynamic pages like: pages |- projects | |- index.js | |- [id] | …
sgrumo
  • 615
  • 2
  • 8
  • 24
1
vote
0 answers

NextJS - Translation multiple in one sentence with next-i18next?

Little post if it can help some people... We want to translate a sentence with 3 different links inside... To do so, let's suppose we have a common.json file and inside we can find a sentence with multiple slot: // /public/locales/en/common.json { …
Paul Bompard
  • 170
  • 1
  • 7
1
vote
1 answer

Display default locale value in url all the time

I am using Next.js i18n-routing in my project and it is working perfect as Index -> / EN -> /about TH -> /th/about But I want to display default locale value (en) in the url all the time if there is no other language Index page -> /en EN ->…
Kaung Khant Zaw
  • 1,508
  • 3
  • 19
  • 31
1
vote
0 answers

Storybook: Can't resolve 'next-i18next/serverSideTranslations'

I have the next-i18next in my Next.js Project. And also add the storybook to my project. When I try to add the story for the home page. I got error Module not found: Error: Can't resolve 'next-i18next/serverSideTranslations' in "xxxx\xxx\" When I…
Xin Ning
  • 51
  • 6
1
vote
1 answer

next-i18next serverSideTranslations causes _app.js to re-render when NextJS route changes

export async function getServerSideProps({ locale }) { const data = await serverSideTranslations(locale, ['apple', 'home']); return { props: data, }; } export default function IndexPage() { return

Hi!

} I noticed…
Viktoria
  • 11
  • 3
1
vote
1 answer

next-i18next Trans component [Object object] instead of proper link

I got some error with interpolation in Trans component in next-i18next. Instead of proper link I get [Object object]. When I check the translation value in React Developers Tools I see that everything is ok. Here is my usage of this…
1
vote
2 answers

Why is i18next-http-middleware defaulting back to fallback language

I am setting up i18next middleware in my express handlebars app, i18next works for any translation I put as the fallbackLng, the problem is none of the i18next middleware features are working like for example getting the lng param from url Here is…
1
vote
0 answers

NextJS translate in _document

Is there a chance I can utilize next-i18next package for adding the translation support for a component in a _document file? Since the translation string injection happens in an _app file, can this somehow be adjusted to support translations…
Aleksandrs
  • 81
  • 6
1
vote
1 answer

Why am I getting undefined with i18next handlebars

I am getting an undefined variable name using i18next with handlebars Following is my code to init i18next with this package: const i18next = require('i18next'); const HandlebarsI18n = require("handlebars-i18n"); import resources from…