mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2025-05-21 10:11:32 -04:00
Move custom loader to main.jsx
So that it's only done once.
This commit is contained in:
parent
6ff652e788
commit
8c374e096d
3 changed files with 6 additions and 6 deletions
src/lib
|
@ -2,17 +2,11 @@ var ReactDOM = require('react-dom');
|
|||
var ReactIntl = require('react-intl');
|
||||
var IntlProvider = ReactIntl.IntlProvider;
|
||||
|
||||
var customLanguages = require('./custom-locales.json');
|
||||
|
||||
var render = function (jsx, element) {
|
||||
// Get locale and messages from global namespace (see "init.js")
|
||||
var locale = window._locale;
|
||||
var messages = window._translations[locale];
|
||||
|
||||
if (customLanguages[locale] !== undefined) {
|
||||
ReactIntl.addLocaleData(customLanguages[locale]);
|
||||
}
|
||||
|
||||
// Render component
|
||||
var component = ReactDOM.render(
|
||||
<IntlProvider locale={locale} messages={messages}>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue