diff --git a/static/js/appearanceDialog.js b/static/js/appearanceDialog.js index 86aede451..def2e3f0f 100644 --- a/static/js/appearanceDialog.js +++ b/static/js/appearanceDialog.js @@ -33,7 +33,7 @@ pandora.ui.appearanceDialog = function() { }), Ox.Select({ id: 'locale', - items: Object.keys(Ox.LOCALE_NAMES).map(function(locale) { + items: pandora.site.languages.map(function(locale) { return {id: locale, title: Ox.LOCALE_NAMES[locale]} }), label: Ox._('Language'), diff --git a/static/js/preferencesDialog.js b/static/js/preferencesDialog.js index 02cf4999e..6a7fe4ca7 100644 --- a/static/js/preferencesDialog.js +++ b/static/js/preferencesDialog.js @@ -121,7 +121,7 @@ pandora.ui.preferencesDialog = function() { }), Ox.Select({ id: 'locale', - items: Object.keys(Ox.LOCALE_NAMES).map(function(locale) { + items: pandora.site.languages.map(function(locale) { return {id: locale, title: Ox.LOCALE_NAMES[locale]} }), label: Ox._('Language'), diff --git a/static/js/utils.js b/static/js/utils.js index 04d5e680a..345d2746f 100644 --- a/static/js/utils.js +++ b/static/js/utils.js @@ -2204,7 +2204,7 @@ pandora.setLocale = function(locale, callback) { var url; // language from http header might not be supported, // fall back to site default - if (Ox.isUndefined(Ox.LOCALE_NAMES[locale])) { + if (pandora.site.languages.indexOf(locale) == -1) { locale = pandora.site.user.ui.locale; } if (locale != 'en') {