Questions tagged [i18next-browser-languagedetector]

13 questions
3
votes
2 answers

Reinitialise i18next instance after cookie accept banner

I'm working on a website and came upon a strange problem with i18next that I can't seem to solve. I want i18next to save the current language in a cookie but only when the user has accepted to store cookies (custom cookie banner…
Reggi
  • 402
  • 8
  • 21
2
votes
2 answers

i18next mapping en-US locale to en namespace folder/file

Sorry if I am not asking this question correctly, currently, our system uses i18next with the i18next-http-backend and i18next-browser-languagedetector. The browser, using i18next-browser-languagedetector returns en-US when the browser is using an…
2
votes
0 answers

Can I use i18next-browser-languageDetector before the (async) initialization of i18next

I'm using i18next and i18next-browser-languageDetector like so: await (i18next .use(initReactI18next) .use(LanguageDetector) .init({ resources, fallbackLng: process.env.DEV ? 'dev' : DEFAULT_LANGUAGE, debug:…
1
vote
1 answer

Change the URL path using I18next-react

Hello there, I can't change the href path (URL) after selecting a new language import i18n from 'i18next'; import { useTranslation, initReactI18next } from 'react-i18next'; import LanguageDetector from 'i18next-browser-languagedetector'; import…
1
vote
0 answers

use react-i18next cookies only if user accepts cookies

I have been using react-i18next for a while and I have recently implemented a Cookie Consent React component. Therefore, I would like to only use cookies in i18next only if the user has accepted them. The first step for me has been to remove the…
1
vote
2 answers

Determining the language by the path of Url

I tried to find a way to change the language by changing the site's sub-path in the next-i18next package, I searched the Internet (https://github.com/isaachinman/next-i18next/issues/32 ,…
0
votes
1 answer

i18next is not using the correct language in Vue project

I have a file called i18n.js and am trying to setup localization in my Vue + Vite app. It's working in the sense that a translation is taking place, but it appears that my setup is wrong based on what I am seeing in the console log. So my browser…
0
votes
1 answer

path detection not working for react-i18next

My code is this but when I go to localhost/fr ,it is not detecting the language from the path? what am i doing wrong here? import { initReactI18next } from "react-i18next"; import LanguageDetector from "i18next-browser-languagedetector"; import…
0
votes
1 answer

How to bind i18next-browser-languagedetector to Kotlin?

The Gradle project is set by the JS plugin: plugins { kotlin("js") version("1.6.10") } and uses the LEGACY compilation backend: kotlin { js(LEGACY) { // ... } } My goal is to use the following dependencies in Kotlin…
Andrei K.
  • 534
  • 7
  • 20
0
votes
1 answer

How to translate long text long text, using react-i18next?

guys. I'm trying to implement localization with i18n to translate my website. I have read the docs and watch some tutos, but they are only focused on one file with only a little string, and I wondered how I could translate a whole paragraph ? Here…
0
votes
3 answers

Can I detect when a language is detected for the first time using i18next-browser-languageDetector?

I have a react app that I have translated into several languages, and also contains some date formatting functionality. I would like to for example, allow the user to change between 12h and 24h time, however when switching to German, automatically…
0
votes
1 answer

Pass localization into an svg image?

Currently, I'm working on a multi-language project in React using i18next. I have a few SVG images that contain a static text language. This is an example from one of the SVG images.
0
votes
1 answer

i18next force detect language again

I'm using the browser language detector for i18next. I'm using the default precedence, which is ['querystring', 'cookie', 'localStorage', 'navigator', 'htmlTag', 'path', 'subdomain'] I want to be able to set localStorage.i18nextLng dynamically, and…
brandones
  • 1,847
  • 2
  • 18
  • 36