I have a react native app and I am using expo.
I want to translate my mobile app so I am going to use expo-localization and i18n-js which I have installed following in the expo documentation.
Then I import it in my App.js as so:
import * as Localization from "expo-localization";
import i18n from "i18n-js";
I have also tried importing it this way :
import * as Localization from "expo-localization";
import { I18n } from "i18n-js";
but when importing i18n I get the following error:
Unable to resolve "make-plural" from "node_modules/i18n-js/dist/import/Pluralization.js"
In my package.json I have the following versions:
"i18n-js": "^4.2.3",
"expo-localization": "~13.1.0",
How can I fix this issue?
Remember to also extend expo/metro-config
const { getDefaultConfig } = require('expo/metro-config');
const config = getDefaultConfig(__dirname);
// Adds support for `mjs` files
config.resolver.sourceExts.push('mjs' );
module.exports = config;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With