Move intl loading into separate, overridden file

ht @rschamp, thanks!
This commit is contained in:
Matthew Taylor 2015-12-16 12:00:42 -05:00
parent 8c374e096d
commit f52ac1f17f
3 changed files with 11 additions and 7 deletions

9
src/lib/intl.jsx Normal file
View file

@ -0,0 +1,9 @@
var ReactIntl = require('react-intl');
var customLanguages = require('../../custom-locales.json');
for (var locale in customLanguages) {
ReactIntl.addLocaleData(customLanguages[locale]);
}
module.exports = ReactIntl;

View file

@ -1,5 +1,6 @@
var ReactDOM = require('react-dom');
var ReactIntl = require('react-intl');
var ReactIntl = require('./intl.jsx');
var IntlProvider = ReactIntl.IntlProvider;
var render = function (jsx, element) {

View file

@ -1,6 +1,3 @@
var ReactIntl = require('react-intl');
var customLanguages = require('../custom-locales.json');
var render = require('./lib/render.jsx');
require('./main.scss');
@ -8,8 +5,5 @@ require('./main.scss');
var Navigation = require('./components/navigation/navigation.jsx');
var Footer = require('./components/footer/footer.jsx');
for (var locale in customLanguages) {
ReactIntl.addLocaleData(customLanguages[locale]);
}
render(<Navigation />, document.getElementById('navigation'));
render(<Footer />, document.getElementById('footer'));