derniercri / react-native-redux-i18n Goto Github PK
View Code? Open in Web Editor NEWUsage of react-native-i18n with redux
License: MIT License
Usage of react-native-i18n with redux
License: MIT License
Hi,
sorry for the question, but how can I re-render the translated strings based on language switcher?
I am using this method I18n.t('greeting')
More than 3 years ago, the react-native-i18n library has been deprecated.
It is the only and the main dependency of this package, so should this package migrate to react-native-localize as suggested from the deprecation warning message ?
In a React-Native 0.70 app, I have the following warning :
react-native-i18n module is not correctly linked
I had to patch react-native-i18n
with :
diff --git a/node_modules/react-native-i18n/index.js b/node_modules/react-native-i18n/index.js
index 6402f5a..4736e57 100644
--- a/node_modules/react-native-i18n/index.js
+++ b/node_modules/react-native-i18n/index.js
@@ -5,7 +5,7 @@
const RNI18n = require('react-native').NativeModules.RNI18n;
const I18nJs = require('i18n-js');
-if (typeof RNI18n !== 'undefined') {
+if (typeof RNI18n !== 'undefined' && RNI18n !== null) {
I18nJs.locale = RNI18n.languages[0];
} else if (__DEV__) {
console.warn('react-native-i18n module is not correctly linked');
in order to prevent the error :
TypeError: Cannot read property 'languages' of null, js engine: hermes
Hi, I tried to implemen your module and Loc tag didn't reload localized text when user switch between locals. I think you forget one condition in Loc file, when you use method shouldComponentUpdate need add nextProps.locale !== this.props.locale, and all will be fine!
Thanks for you perfect module!
Hello :)
i would like try your module, but i've this error after run npm start
:
Loading dependency graph, done.
Bundling `index.js` [development, non-minified] 0.0% (0/1), failed.
error: bundling failed: ambiguous resolution: module `/home/user/project/index.js` tries to require `react-native`, but there are several files providing this module. You can delete or fix them:
* `/home/user/project/node_modules/react-native-redux-i18n/node_modules/react-native/package.json`
* `/home/user/project/node_modules/react-native/package.json`
I've try to delete /node_modules/react-native-redux-i18n/node_modules/react-native
folder, but same result.
Do you have any idea for fix this ?
Thank you ;)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.