# Converting from react-intl to react-i18next

**URL:** https://talk.openelis-global.org/t/converting-from-react-intl-to-react-i18next/1584
**Category:** Uncategorized
**Created:** [June 25, 2025, 2:35pm UTC](https://talk.openelis-global.org/t/converting-from-react-intl-to-react-i18next/1584 "2025-06-25T14:35:59Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Lemeri123](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.openelis-global.org/lemeri123/32/781_2.png) [@Lemeri123](https://talk.openelis-global.org/u/Lemeri123)
#### Post date: [June 25, 2025, 2:35pm UTC](https://talk.openelis-global.org/t/converting-from-react-intl-to-react-i18next/1584/1 "2025-06-25T14:35:59Z")

</div>

We are migrating our internationalization (i18n) setup from **`react-intl`** to **`react-i18next`** to load translations dynamically. The goal is to;

1. Replace `FormattedMessage`, `useIntl`, and `IntlProvider` with `react-i18next`’s `useTranslation` hook and `I18nextProvider`.
2. Load translations dynamically (previously hardcoded JSON imports).
3. Maintain existing translation keys

### **Progress**

1. Created a react-i8next (i18n.js) file to handle the configurations
2. Converted App.js to align and use react-i18next and replaced all react-intl instances

### **Current Blocker**

Despite installing the required dependencies (`i18next`, `react-i18next`, `i18next-browser-languagedetector`), I am encountering:  
Uncaught Error: Cannot find module ‘i18next-browser-languagedetector’  
and this results into nothing being displayed on the browser

The error persists even after verifying the package is installed (`npm list` confirms it exists in `node_modules`).

**Thanks in advance for your help!**

---

<div class="post-metadata">

### Author: ![tasksolver](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.openelis-global.org/tasksolver/32/1067_2.png) [@tasksolver](https://talk.openelis-global.org/u/tasksolver)
#### Post date: [June 25, 2025, 5:03pm UTC](https://talk.openelis-global.org/t/converting-from-react-intl-to-react-i18next/1584/2 "2025-06-25T17:03:04Z")

</div>

interesting news @Lemeri123 , thanks. For the error your are encountering, sharing details on the error, ie. screenshots can be helpful in trouble shooting

---

<div class="post-metadata">

### Author: ![Agaba\_Derrick\_Junior](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.openelis-global.org/agaba_derrick_junior/32/503_2.png) [@Agaba\_Derrick\_Junior](https://talk.openelis-global.org/u/Agaba_Derrick_Junior)
#### Post date: [June 26, 2025, 6:10am UTC](https://talk.openelis-global.org/t/converting-from-react-intl-to-react-i18next/1584/3 "2025-06-26T06:10:45Z")

</div>

> [@Lemeri123](#):
>
> We are migrating our internationalization (i18n) setup from **`react-intl`** to **`react-i18next`** to load translations dynamically. The goal is to;
> 
> 1. Replace `FormattedMessage`, `useIntl`, and `IntlProvider` with `react-i18next`’s `useTranslation` hook and `I18nextProvider`.
> 2. Load translations dynamically (previously hardcoded JSON imports).
> 3. Maintain existing translation keys
> 
> ### **Progress**
> 
> 1. Created a react-i8next (i18n.js) file to handle the configurations
> 2. Converted App.js to align and use react-i18next and replaced all react-intl instances
> 
> ### **Current Blocker**
> 
> Despite installing the required dependencies (`i18next`, `react-i18next`, `i18next-browser-languagedetector`), I am encountering:  
> Uncaught Error: Cannot find module ‘i18next-browser-languagedetector’  
> and this results into nothing being displayed on the browser
> 
> The error persists even after verifying the package is installed (`npm list` confirms it exists in `node_modules`).
> 
> **Thanks in advance for your help!**

@Lemeri123 A couple of days I checked about this and I thought we had created an issue about it, am glad its up now  
I’m hoping that our import is something like `import LanguageDetector from 'i18next-browser-languagedetector';`

otherwise are we able to have the logs for the error ?

---

<div class="post-metadata">

### Author: ![aditya](https://avatars.discourse-cdn.com/v4/letter/a/df705f/32.png) [@aditya](https://talk.openelis-global.org/u/aditya)
#### Post date: [June 26, 2025, 6:45am UTC](https://talk.openelis-global.org/t/converting-from-react-intl-to-react-i18next/1584/4 "2025-06-26T06:45:18Z")

</div>

> [@Lemeri123](#):
>
> ### **Current Blocker**
> 
> Despite installing the required dependencies (`i18next`, `react-i18next`, `i18next-browser-languagedetector`), I am encountering:  
> Uncaught Error: Cannot find module ‘i18next-browser-languagedetector’  
> and this results into nothing being displayed on the browser
> 
> The error persists even after verifying the package is installed (`npm list` confirms it exists in `node_modules`).

This issue you’re facing is because the frontend is running inside docker and inside docker you latest package.json doesn’t goes in!

You have to manually build the frontend IMAGE locally first and use that image as a container, and after that, only you will be able to test `i18-lang-interpretor`!

---

<div class="post-metadata">

### Author: ![Lemeri123](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.openelis-global.org/lemeri123/32/781_2.png) [@Lemeri123](https://talk.openelis-global.org/u/Lemeri123)
#### Post date: [June 26, 2025, 7:03am UTC](https://talk.openelis-global.org/t/converting-from-react-intl-to-react-i18next/1584/5 "2025-06-26T07:03:56Z")

</div>

![image](https://canada1.discourse-cdn.com/flex030/uploads/openelisci/original/1X/91572c06b9f99a0d9d5a73abe520d581e23013cf.png)  
This is the error am encountering

---

<div class="post-metadata">

### Author: ![Lemeri123](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.openelis-global.org/lemeri123/32/781_2.png) [@Lemeri123](https://talk.openelis-global.org/u/Lemeri123)
#### Post date: [June 26, 2025, 7:06am UTC](https://talk.openelis-global.org/t/converting-from-react-intl-to-react-i18next/1584/6 "2025-06-26T07:06:22Z")

</div>

Oh yes most certainly @Agaba_Derrick_Junior. That is the import and as for the logs of the error, they are provided in the screenshot I provided

---

<div class="post-metadata">

### Author: ![Lemeri123](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.openelis-global.org/lemeri123/32/781_2.png) [@Lemeri123](https://talk.openelis-global.org/u/Lemeri123)
#### Post date: [June 26, 2025, 7:14am UTC](https://talk.openelis-global.org/t/converting-from-react-intl-to-react-i18next/1584/7 "2025-06-26T07:14:54Z")

</div>

So @aditya basically what you mean is I should recreate the containers to rebuild the frontend with the updated `package.json` and `node_modules`??.

---

<div class="post-metadata">

### Author: ![aditya](https://avatars.discourse-cdn.com/v4/letter/a/df705f/32.png) [@aditya](https://talk.openelis-global.org/u/aditya)
#### Post date: [June 26, 2025, 11:21am UTC](https://talk.openelis-global.org/t/converting-from-react-intl-to-react-i18next/1584/8 "2025-06-26T11:21:21Z")

</div>

no you have to rebuild the fronted-imgae-using Dockerfile preasent for frontent and use that image inside dev.docker-compose.yml! file

---

<div class="post-metadata">

### Author: ![Lemeri123](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.openelis-global.org/lemeri123/32/781_2.png) [@Lemeri123](https://talk.openelis-global.org/u/Lemeri123)
#### Post date: [July 2, 2025, 9:06am UTC](https://talk.openelis-global.org/t/converting-from-react-intl-to-react-i18next/1584/9 "2025-07-02T09:06:02Z")

</div>

So far, React-i18next has been successfully initialized and working fine.  
 ![image](https://canada1.discourse-cdn.com/flex030/uploads/openelisci/optimized/1X/25761cbac3ed262b611e00ff7be0d58493c45207_2_690x35.png)  
**`i18next: initialized`**  
Means i18next successfully started with the config file.  
**`i18next: languageChanged es`**  
i18next successfully switched to Spanish (es), showing the language detector and system are both working.  
Thanks everyone
