Questions tagged [next-i18next]

165 questions
0
votes
1 answer

Use i18next translation hook for error messages

So I have a form which works fine and for error messages I have created a schema file which contains errors defined like this export const dataInputCreateSchema = yupObject({ company: yup.object().required('This field is required').nullable …
Ehsan Nissar
  • 643
  • 2
  • 13
  • 35
0
votes
1 answer

Nextjs dynamic routes with next-i18next build error

I have an edit page that will be rendered with an id parameter and it works fine when application is running but while building the nextjs app I get this error [Error: ENOENT: no such file or directory, rename 'C:\Users\Ahsan…
Ehsan Nissar
  • 643
  • 2
  • 13
  • 35
0
votes
1 answer

Exporting more than 1 default in Next _app.tsx

I came to this tricky situation, where I need to "export 2 defaults in my Next _app file (using typescript). I started to export it for Redux, which I am using in my app export default wrapper.withRedux(MyApp); But now I need to translate my app…
user15030566
0
votes
1 answer

How to pass i18n or t function to dependency using next-i18next

I have two repositories. One with nextjs application and second one with components that are being dynamically loaded into the first repo. Since some of the components in second repo contain translations, I need to pass down a t function or an i18n…
0
votes
1 answer

Best practice: prepare props only once for rendering

Consider the following simple page in a nextjs app: type MyProps = { myData: string[] } export const getServerSideProps: GetServerSideProps = async ({ req, res }) => { return { props: {myData: calcData()} } } function…
Steffen Harbich
  • 2,639
  • 2
  • 37
  • 71
0
votes
1 answer

next-i18next 404 error when trying to access any page with localeSubpaths config provided

I'm facing the 404 issue when trying to access any page of my Next.js application. App works fine when no localeSubpaths config is provided. After implementing localeSubpaths config (next.config.js): const localeSubpaths = { en: "en", "de-DE":…
0
votes
1 answer

next-i18next and redux, where to store the current locale

I have an app with next.js and next-i18next for the internationalization. I need to store the current locale and I'm trying to figure out how to do it. maybe in the _app.tsx or the _document.tsx/ where do I get the current locale? from the instance…
user4351649
0
votes
1 answer

Invalid configuration: Current language is not included in all languages array i18next

I'm use NextJS and i18next Here is my config file const NextI18Next = require('next-i18next').default; module.exports = new NextI18Next({ localePath: 'public/static/locales', browserLanguageDetection: false, serverLanguageDetection: false, …
0
votes
1 answer

Keep having namespacesRequired even if declared

I have setup next-18next with my NextJS and React project, the translation works perfectly in my project. But I keep having the famous following warning : You have not declared a namespacesRequired array on your page-level component:…
Topsy
  • 1,023
  • 1
  • 11
  • 26
0
votes
1 answer

404 for all routes with included locale - NextJS with next-i18next

Hi I am following the docs from here: github docs , but all URLs with locales return 404. For the example: localhost:3000/de/second-page = 404 localhost:3000/en/second-page = 404 localhost:3000/de = 404 localhost:3000/en = 404 same for the default…
gdfgdfg
  • 3,181
  • 7
  • 37
  • 83
0
votes
1 answer

next react build failed with error Error: Package exports for '/app/node_modules/i18next-http-middleware' do not define a valid './cjs' target

When i run the the build server.js thes error happens i have added the files responsible for this code please let me know i need to put any more details of my code app # npm run server:dev partner-portal@0.1.0 server:dev /app node…
0
votes
0 answers

Next js with i18next module not found issue

I have a nextjs type script application using i18next. my i18n file is in typescript the build of the project was successfull but when i had to run it says it cannot load the i18n module which is in typescript what is the work around this my…
Snivio
  • 1,741
  • 1
  • 17
  • 25
0
votes
2 answers

having CORS when changing language with next-i18next library

i'm having cors when changing language with i18n.changeLanguage function.I have two buttons that have onClick method and call a custom function named changeLang.Inside that function i am calling i18n.changeLanguage function and pass it to the lng…
isa_toltar
  • 586
  • 5
  • 11
-1
votes
1 answer

nexti18-next translation not being displayed

With my latest prod deployment, for some reason my translations aren't being displayed. I see that the file is loaded and that the translation is present. But it seems that the translation isn't being found. Update: Seems this is the same on…
sspahic2
  • 11
  • 3
-1
votes
1 answer

How to create a multi-language support web application by using Typescript with Next JS?

I want to create a Production level web application with Typescript, Nextjs & as backend Nodejs MongoDB separately(client folder, server folder). And language is a must requirement in this application. Admin wants to input in English and for further…
Arif hossain
  • 439
  • 2
  • 6
  • 8
1 2 3
10
11