mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-23 07:38:07 -05:00
Move intl loading into separate, overridden file
ht @rschamp, thanks!
This commit is contained in:
parent
8c374e096d
commit
f52ac1f17f
3 changed files with 11 additions and 7 deletions
9
src/lib/intl.jsx
Normal file
9
src/lib/intl.jsx
Normal 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;
|
|
@ -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) {
|
||||
|
|
|
@ -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'));
|
||||
|
|
Loading…
Reference in a new issue