Set only available languages

This commit is contained in:
Gustavo Maximiliano Cortez 2016-01-08 11:03:56 -03:00
commit c63e35acfe
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF
2 changed files with 6 additions and 20 deletions

View file

@ -9,21 +9,12 @@ angular.module('copayApp.services')
}, {
name: 'Français',
isoCode: 'fr',
}, {
name: 'Italiano',
isoCode: 'it',
}, {
name: 'Deutsch',
isoCode: 'de',
}, {
name: 'Español',
isoCode: 'es',
}, {
name: 'Português',
isoCode: 'pt',
}, {
name: 'Ελληνικά',
isoCode: 'el',
}, {
name: '日本語',
isoCode: 'ja',
@ -31,9 +22,6 @@ angular.module('copayApp.services')
}, {
name: 'Pусский',
isoCode: 'ru',
}, {
name: 'Türk',
isoCode: 'tr',
}];
root.currentLanguage = null;
@ -50,6 +38,11 @@ angular.module('copayApp.services')
}
userLang = userLang ? (userLang.split('-', 1)[0] || 'en') : 'en';
// Set only available languages
userLang = lodash.find(root.availableLanguages, {
'isoCode': userLang
}) ? userLang : 'en';
return userLang;
};