Add a warning when the package is not linked
This commit is contained in:
parent
31f54d1a95
commit
13c8bd50c7
7
index.js
7
index.js
|
@ -3,6 +3,11 @@
|
||||||
const RNI18n = require('react-native').NativeModules.RNI18n;
|
const RNI18n = require('react-native').NativeModules.RNI18n;
|
||||||
const I18nJs = require('i18n-js');
|
const I18nJs = require('i18n-js');
|
||||||
|
|
||||||
I18nJs.locale = RNI18n.languages[0];
|
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 const getLanguages = RNI18n.getLanguages;
|
||||||
export default I18nJs;
|
export default I18nJs;
|
||||||
|
|
Loading…
Reference in New Issue