only use enabled languages

This commit is contained in:
j 2014-04-01 14:23:33 +00:00
parent ea2a5620f6
commit e4e7fb87b1
3 changed files with 3 additions and 3 deletions

View file

@ -33,7 +33,7 @@ pandora.ui.appearanceDialog = function() {
}), }),
Ox.Select({ Ox.Select({
id: 'locale', 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]} return {id: locale, title: Ox.LOCALE_NAMES[locale]}
}), }),
label: Ox._('Language'), label: Ox._('Language'),

View file

@ -121,7 +121,7 @@ pandora.ui.preferencesDialog = function() {
}), }),
Ox.Select({ Ox.Select({
id: 'locale', 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]} return {id: locale, title: Ox.LOCALE_NAMES[locale]}
}), }),
label: Ox._('Language'), label: Ox._('Language'),

View file

@ -2204,7 +2204,7 @@ pandora.setLocale = function(locale, callback) {
var url; var url;
// language from http header might not be supported, // language from http header might not be supported,
// fall back to site default // 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; locale = pandora.site.user.ui.locale;
} }
if (locale != 'en') { if (locale != 'en') {