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
1 changed files with 4 additions and 4 deletions

View File

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