react-i18next Questions

2

Solved

I am using ReactJS for a small website. I decided to use i18next for the internationalization and it works - unless I use a nested reference for the translation key. In the following example the in...
Diamond asked 28/8, 2019 at 11:43

3

I'm currently working on a multilingual Next.js 13 application, and I'm using the next-intl package for internationalization. I've been trying to set up translated URLs for my routes, but I'm runni...
Fatuous asked 10/5, 2023 at 14:35

4

I followed the react-i18next docs and internationalized my React app. I use the useTranslation hook, which gives me the "t" object. All nice and smooth for now, but I have some non-Hook utility fu...
Arrack asked 9/11, 2019 at 19:32

2

Solved

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 translatio...
Sunn asked 5/5, 2021 at 17:11

6

This is my code. import React, { Suspense } from 'react'; import { useTranslation } from 'react-i18next'; function Page() { const { t, i18n } = useTranslation(); const changeLanguage = lng =&...
Nava asked 30/9, 2019 at 22:59

7

Is there a possibility to type check existing keys in react-i18next dictionaries? So that TS will warn you during compile time if key doesn't exist. Example. Suppose, we have this dictionary: { ...
Luster asked 7/10, 2019 at 22:36

6

I have a problem with I18next. I can't figure out how to make links to websites work, here is my code: import React, { Suspense } from "react"; import i18n from "i18next"; impor...
Paraformaldehyde asked 18/1, 2022 at 8:55

7

Solved

I am using react, i18next and react-i18next. I would like to have some translatable text with HTML link in the middle of the text which is interpolated in react, something like this: This is my t...
Phosphorescent asked 24/4, 2017 at 12:15

4

I am using react-i18next. Sometime on init function component facing React issue. Any idea what may causing it? My config import i18n from "i18next"; import resources from "./locale...
Octagon asked 3/1, 2021 at 8:46

3

Solved

I need to do translation in my middleware (import { Middleware } from 'redux') logic, but I can't use useTranslation hook (import { useTranslation } from 'react-i18next'). How do you standardly sol...
Interlunation asked 27/4, 2021 at 12:30

4

Solved

I have a react based application and use i18next's Trans component for translations. Let's say we have a user registration form and we want to confirm that a new account has been created by displ...
Aorta asked 7/10, 2019 at 12:19

7

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...
Seeseebeck asked 6/4, 2021 at 17:47

7

I am using react-i18next in my app to great effect but when I run the unit tests against my component: const OptionList = ({ definition, name, status = EMutationStatus.IDLE, onChange = () =>...
Tuna asked 13/8, 2021 at 10:35

6

I have a static file called translations.json which includes my translations: { "common": { "greeting": "We will see you at NEW YORK in the morning!" } } Within my...
Titanic asked 31/1, 2021 at 2:6

2

Solved

I have a nextjs app, which I want to extend using i18next and next-i18next (https://github.com/isaachinman/next-i18next). The default configuration is looking for json files under ./public/locales/...
Dygall asked 15/6, 2021 at 10:47

4

My react component uses translations from i18next and I'm trying to create tests for it using JEST. However, nothing is getting translated and I have tried mocking the useTranslation function below...
Tendance asked 23/5, 2019 at 0:27

3

Solved

I know that react-i18next work in every component: functional (with useTranslation) and class component (with withTranslation()) BUT I can't use translation inside a basic function like this: cons...
Frijol asked 10/9, 2019 at 4:29

2

I was trying to implement i18n localization for Redux Action functions, but i constantly recieve different hook errors. When i implemented i18n this way i recieve error. Line 428:17: React Hook &qu...
Pascasia asked 4/11, 2021 at 12:0

4

Solved

I'm trying to use react-i18next with a translation json that contains some HTML tags, like this: // en.json { "welcome": "Welcome to our site, <strong>{{name}}</strong>&q...
Carpathoukraine asked 17/4, 2020 at 9:14

2

Is there a way to check if a locale exists on react app ? Like a boolean true/false
Vanna asked 31/5, 2022 at 7:50

5

Solved

package.json "moduleNameMapper": { "i18next": "<rootDir>/__mocks__/i18nextMock.js" } i18n.js import i18n from 'i18next' import XHR from 'i18next-xhr-backend' // import Cache from 'i18nex...
Siglos asked 10/7, 2017 at 20:15

2

Solved

Error: Uncaught [Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your com...
Deemphasize asked 31/12, 2020 at 13:32

2

I am using v10 of react-i18next and the latest Trans component to have a translation string with a portion of the sentence bolded. In the HTML I can insert a   to ensure there is a space ...
Stagger asked 10/4, 2019 at 17:38

3

Solved

I'm using React with react-i18next My index.tsx File contains some components and I can use the Translation function there index.js import React, { Suspense } from 'react' import ReactDOM from '...
Headfirst asked 18/12, 2019 at 15:5

2

Solved

I have an input component that the user should enter in text in different languages. Therefore I want the placeholder to be translated to different languages, when the user chooses which language h...
Sedulity asked 27/9, 2022 at 17:53

© 2022 - 2024 — McMap. All rights reserved.