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

This reverts commit 4f541b8831.
This commit is contained in:
Matthew Taylor 2015-12-16 10:09:15 -05:00
parent 4f541b8831
commit 6ff652e788
4 changed files with 24 additions and 10 deletions

View file

@ -49,7 +49,6 @@
<script src="/js/lib/react{{min}}.js"></script>
<script src="/js/lib/react-dom{{min}}.js"></script>
<script src="/js/lib/react-intl-with-locales{{min}}.js"></script>
<script src="/js/lib/custom-locales.js"></script>
<script src="/js/lib/raven.min.js"></script>
<script src="/js/main.bundle.js"></script>

View file

@ -0,0 +1,18 @@
{
"an": {
"locale": "an",
"parentLocale": "ca"
},
"la": {
"locale": "la",
"parentLocale": "it"
},
"yum": {
"locale": "yum",
"parentLocale": "en"
},
"cat": {
"locale": "cat",
"parentLocale": "en"
}
}

View file

@ -2,11 +2,17 @@ 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}>

View file

@ -1,9 +0,0 @@
var customLanguages = {
'an': {'locale': 'an','parentLocale': 'ca'},
'la': {'locale': 'la','parentLocale': 'it'},
'yum': {'locale': 'yum','parentLocale': 'en'},
'cat': {'locale': 'cat','parentLocale': 'en'}
};
for (var locale in customLanguages) {
ReactIntl.addLocaleData(customLanguages[locale]);
}