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
|
|
|
|
2017-09-08 19:39:23 +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-12-12 02:00:40 +00:00
|
|
|
export const getLanguages = () => RNI18n.getLanguages();
|
2017-08-27 19:11:00 +00:00
|
|
|
export default I18nJs;
|