react-native-i18n/index.js

16 lines
354 B
JavaScript
Raw Normal View History

2015-06-14 12:14:02 +00:00
'use strict';
2015-06-14 10:47:18 +00:00
2015-12-11 12:37:50 +00:00
let { Platform, NativeModules } = require('react-native')
let { RNI18N } = NativeModules
let I18n = require('./vendor/i18n')
2015-06-14 12:14:02 +00:00
if (Platform.OS === 'android') {
RNI18n.getCurrentLocale( function(locale) {
I18n.locale = locale.replace(/_/, '-');
});
} else {
I18n.locale = RNI18n.locale.replace(/_/, '-');
}
2015-06-14 10:47:18 +00:00
module.exports = I18n;