Questions tagged [i18next]

i18next is a full-featured i18n javascript library for translating your webapplication.

i18next is a full-featured i18n javascript library for translating your webapplication.

1430 questions
6
votes
5 answers

How to fix `TypeError: Cannot read property 'type' of undefined` when testing i18next with Jest

I have a react project and I have included i18next = 15.0.4 and react-i18next = 10.2.0 dependencies. I have created a module for initializing i18next with react-i18next and I'm trying to unit test this code using Jest. I tried importing my i18n…
Jesus
  • 318
  • 1
  • 4
  • 17
6
votes
2 answers

react i18next "hooks" error when using t() from useTranslation()

I am using React-i18next library and I need to get a translation function t() inside of a function. export function translateCell(cell) { const { t } = useTranslation(); return (t(cell)); } When using useTranslation() it fails with error…
6
votes
2 answers

Loading translations from multiple backends

I have React app using react-i18next, the translations are stored in two locations. One set is stored locally to the app in a folder, the rest of the translations come from a remote API. I am struggling to have both sets loaded into the app. Using…
Rob Holmes
  • 183
  • 1
  • 4
6
votes
3 answers

Connecting NextJS, next-i18next, with-redux, with-redux-saga: "Error: If you have a getInitialProps method in your custom _app.js file..."

I'm trying to connect a functioning NextJS/React app that uses 'with-redux-saga' and 'with-redux' to 'next-i1iN' (https://github.com/isaachinman/next-i18next) -- but when my app boots I get the following error: Error: If you have a getInitialProps…
Cerulean
  • 5,543
  • 9
  • 59
  • 111
6
votes
2 answers

Google Apps Script error with i18next module

I am writing my project in ES6, and currently facing an issue with i18next module. https://www.i18next.com/ On my local system, when I import i18next import i18next from 'i18next'; and use it in my source files everything works. However after I run…
6
votes
2 answers

Escape special characters in i18next

So i have this variable that will consist in something like '<123456789>' and then i have this: var vocab = mm('responses.positive', { lngs:LANG, target: User.tag, amount: r * multiplier, icon: iconFile }) this…
Lucas Flicky
  • 126
  • 1
  • 1
  • 9
6
votes
1 answer

jquery-i18next - usage, change language by user, load translation from files

I was looking for an internationalization framework and came across jqueryi-18next.js. I'm actually totally confused by using this plugin as the code in the sample file is different from the documentation. My modified sample.html where I added two…
tschortsch
  • 107
  • 1
  • 8
6
votes
1 answer

using multiple translation files in aurelia i18N

I have a working app using aurelia-i18n. I would like to split translation.json file into multiple files like nav.json, message.json, etc but I am not sure how to do it. This is how it looks right now. locale |-en |-…
Golden mole
  • 503
  • 6
  • 14
6
votes
3 answers

i18next best practice

I've successfully implemented i18next, which by the way is a great library! Though I'm still in search for the "best practice". This is the setup I have right now, which in general I like: var userLanguage = 'en'; // set at runtime i18n.init({ …
6
votes
2 answers

Marionette.Renderer, Underscore templates and internationalization with i18next

We are currently in the need of adding internationalization to a medium sized app using Backbone.Marionette and underscore templates. After some thorough research, two valid options are emerging : underi18n which provides direct integration with…
5
votes
2 answers

How to iterate i18n array of objects in React app?

I use i18n package in my React application to translate some texts. But I can't iterate through an array of objects which is my translation data. I want to do iterating through socials array and show it in my template. but when I do that, it says:…
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
0 answers

next-i18next was unable to find a user config

i was trying to add translation to my app, but i'm stuck on this error: error - Error: next-i18next was unable to find a user config at _callee$…
Coyas
  • 73
  • 1
  • 10
5
votes
3 answers

Nested namespaces in i18n

My application is rather large, so to have a more organized translation file I want to use nasted namespaces. Example: { "contract": { "index": { "pageTitle": "Contract" } } The problem with this is when I'm accessing…
Pelicer
  • 1,348
  • 4
  • 23
  • 54
5
votes
1 answer

react i18next throws translator missingKey en translation and useTranslation() hooks not working

I am setting up the react-i18n-next hook to translate my app and i followed the example that the react-i18n-next use but it throws error like below: i18next::translator: missingKey en-US translation App.js import React, { Component, Suspense }…
user0227
  • 113
  • 1
  • 2
  • 7