Uniform code and fix for test friendliness (mocha)

- replace let with const
- check existence of `RNI18n` when accessing it's properties
- remove unnecessary code
This commit is contained in:
Samuli Hakoniemi 2016-06-16 15:39:55 +03:00 committed by GitHub
parent 5fa3e0e542
commit c6691e049a

View File

@ -1,9 +1,9 @@
'use strict'; 'use strict';
let { Platform, NativeModules } = require('react-native') const { NativeModules } = require('react-native');
let { RNI18n } = NativeModules const { RNI18n } = NativeModules;
let I18n = require('./vendor/i18n') let I18n = require('./vendor/i18n');
I18n.locale = RNI18n.locale.replace(/_/, '-'); I18n.locale = (RNI18n) ? RNI18n.locale.replace(/_/, '-') : '';
module.exports = I18n; module.exports = I18n;