Add a warning when the package is not linked
This commit is contained in:
parent
31f54d1a95
commit
13c8bd50c7
5
index.js
5
index.js
|
@ -3,6 +3,11 @@
|
|||
const RNI18n = require('react-native').NativeModules.RNI18n;
|
||||
const I18nJs = require('i18n-js');
|
||||
|
||||
if (typeof RNI18n !== 'undefined') {
|
||||
I18nJs.locale = RNI18n.languages[0];
|
||||
} else if (__DEV__) {
|
||||
console.warn('react-native-i18n module is not correctly linked');
|
||||
}
|
||||
|
||||
export const getLanguages = RNI18n.getLanguages;
|
||||
export default I18nJs;
|
||||
|
|
Loading…
Reference in New Issue