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
20
votes
2 answers

What are the options for making a simple static website multilingual?

I'm setting up a static website which I want to display in two languages. I can't find a comprehensive overview of the different options (e.g. server-side loading vs front-end loading vs using different folders. What are the advantages of each…
19
votes
3 answers

How to translate routes with NextJS and next-i18next?

I'm building a multiple language website with next.JS and the package next-i18next. It's going well, except one thing that I'm not sure what's the best approach. I want that my static routes will be translated too (not only the page content), for…
Alexandre Paiva
  • 987
  • 2
  • 10
  • 24
19
votes
3 answers

Translate custom attributes with i18next (placeholder, value)

I am investigating what is possible with i18next localization library. Right now I have the following code (full Fiddle is here): HTML
Salvador Dali
  • 214,103
  • 147
  • 703
  • 753
18
votes
6 answers

react-i18next:: You will need to pass in an i18next instance by using initReactI18next warning thrown in Jest unit test

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 = () => null, value = [], }: IOptionListProps):…
RyanP13
  • 7,413
  • 27
  • 96
  • 166
17
votes
3 answers

i18next json dot in key or label

JS: i18n.t("SOME TEXT TO BE TRANSLATED.") JSON: "SOME TEXT TO BE TRANSLATED.": "Een stukje tekst om te vertalen" i18n.t("SOME TEXT TO BE TRANSLATED.") gives me "SOME TEXT TO BE TRANSLATED.". If I remove the "." (dot) from the label and the function…
Sven Cornelis
  • 331
  • 3
  • 9
16
votes
2 answers

How to switch languages with the i18next plugin?

I am using Backbone.js in my application and the i18next plugin for my language switch function on my application. When I pass a value to the lng option in the init function call, then it translates my page correctly. Now I want to do this…
harsh
  • 175
  • 1
  • 1
  • 8
14
votes
2 answers

i18next translation outside component

I'm new for i18next, trying to localize/translate website. Everything works for translation inside of component, but outside (means json files with i18n.t() it doesn't retrieve needed information, instead showing default value. I'm using…
Osia
  • 173
  • 1
  • 2
  • 11
14
votes
1 answer

i18next is not loading the translation file

I am working on some Backbone based project where i am using i18next for locales. Following is my app.js code: /* This file is used to initialize your application. */ require(['i18n','application','handlebars_Helpers'], function(i18n,…
Ashwin Hegde
  • 1,733
  • 4
  • 19
  • 49
12
votes
1 answer

how do I interpolate a Link component in Next-i18next / React i18next that changes position in the text

Currently I'm using Next.js with Next-i18next for I18N, but I understand that the React/i18next implementation is basically the same. The problem I'm having is that I need to interpolate a next Link component inside some translation text, but…
HJEC
  • 400
  • 3
  • 11
12
votes
4 answers

Using react i18next on all nested components

I have a question regarding the multi-language support for complex React application. All examples and documentation are based on "flat" application without nested/child components. How to approach data nested like this:
J33nn
  • 3,034
  • 5
  • 30
  • 46
11
votes
2 answers

How can we load translations using api calls instead of having them defined in static jsons? How can this be done in React-i18next?

On using internationalization in React application, Need to load the language translation files on demand using api calls and not have them defined upfront. How can this be achieved by using React-i18next? Tried out the normal translations being…
Abhilasha
  • 121
  • 1
  • 1
  • 6
11
votes
2 answers

Replacing variables in i18next

I have implemented i18next, and after getting help on a couple of issues all works fine. I still have issues understanding parts of the documentation on the support site. I'm trying to replicate this part (found here): // given resources { …
user3727189
10
votes
2 answers

How to properly load i18n resources in next-i18next from api endpoints?

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/{lng}/{ns}.json, where lng is the language and ns a…
Marco
  • 22,856
  • 9
  • 75
  • 124
10
votes
2 answers

react-i18next not loading json translation files in React app created with create-react-app

I've created a React application with create-react-app I want to implement translations and I've discovered react-i18next After installing required packages I've setup my i18n.js config file: import i18n from 'i18next'; import LanguageDetector from…
Cristian Rojas
  • 2,746
  • 7
  • 33
  • 42
10
votes
1 answer

How to apply a formatter in nested translations with i18next

I would like to format nested translations with i18next Given the resources: { translation: { en: { food: 'bread', food_is_good: "$t(food), that's not bad", }, }, } and a formatting function: function format(value, format,…
Arjan
  • 1,034
  • 8
  • 29
1
2
3
95 96