Replace hardcoded RTL list with detected language lookup from dataLocales

This commit is contained in:
Bryan Housel
2016-11-28 00:12:50 -05:00
parent fc0b8a6a90
commit 3f024d0b95
2 changed files with 5 additions and 3 deletions
+2 -2
View File
@@ -307,7 +307,7 @@ export function coreContext() {
};
context.loadLocale = function(callback) {
if (locale && locale !== 'en' && dataLocales.indexOf(locale) !== -1) {
if (locale && locale !== 'en' && dataLocales.hasOwnProperty(locale)) {
localePath = localePath || context.asset('locales/' + locale + '.json');
d3.json(localePath, function(err, result) {
if (!err) {
@@ -351,7 +351,7 @@ export function coreContext() {
context.projection = geoRawMercator();
locale = utilDetect().locale;
if (locale && dataLocales.indexOf(locale) === -1) {
if (locale && !dataLocales.hasOwnProperty(locale)) {
locale = locale.split('-')[0];
}