react-native-i18n/index.js

14 lines
348 B
JavaScript
Raw Normal View History

2017-04-07 17:21:55 +00:00
// @flow
2015-06-14 10:47:18 +00:00
2017-08-27 19:11:00 +00:00
const RNI18n = require('react-native').NativeModules.RNI18n;
const I18nJs = require('i18n-js');
2017-04-07 17:21:55 +00:00
if (typeof RNI18n !== 'undefined') {
I18nJs.locale = RNI18n.languages[0];
} else if (__DEV__) {
console.warn('react-native-i18n module is not correctly linked');
}
2017-05-25 15:49:37 +00:00
export const getLanguages = RNI18n.getLanguages;
2017-08-27 19:11:00 +00:00
export default I18nJs;