Move custom-locales.js to static/js/lib

So it can be loaded ahead of time and cached. Also remove the json since it's being loaded outside of react now, and put it into the js file directly.
This commit is contained in:
Matthew Taylor 2015-12-16 08:31:44 -05:00
parent b495beaeba
commit 4f541b8831
4 changed files with 10 additions and 24 deletions
src/lib

View file

@ -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}>