diff options
author | Ghassen Rjab <rjab.ghassen@gmail.com> | 2017-06-18 17:21:46 +0100 |
---|---|---|
committer | Ghassen Rjab <rjab.ghassen@gmail.com> | 2017-06-18 17:21:46 +0100 |
commit | a9dde296bf732f023c2ae324830ad235d920ca49 (patch) | |
tree | 327afb94d4117bdb34848b75efeceed8d2b46194 /client/components/users | |
parent | cdddf42847c49a0dbdfa83c3b9bcd536a7434f49 (diff) | |
download | wekan-a9dde296bf732f023c2ae324830ad235d920ca49.tar.gz wekan-a9dde296bf732f023c2ae324830ad235d920ca49.tar.bz2 wekan-a9dde296bf732f023c2ae324830ad235d920ca49.zip |
Sort available languages by their translated names
Diffstat (limited to 'client/components/users')
-rw-r--r-- | client/components/users/userHeader.js | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/client/components/users/userHeader.js b/client/components/users/userHeader.js index 73a11fc0..10fb7e62 100644 --- a/client/components/users/userHeader.js +++ b/client/components/users/userHeader.js @@ -72,9 +72,17 @@ Template.changePasswordPopup.onRendered(function() { Template.changeLanguagePopup.helpers({ languages() { - return _.map(TAPi18n.getLanguages(), (lang, tag) => { - const name = lang.name; - return { tag, name }; + return _.map(TAPi18n.getLanguages(), (lang, code) => { + return { + tag: code, + name: lang.name, + }; + }).sort(function(a, b) { + if (a.name === b.name) { + return 0; + } else { + return a.name > b.name ? 1 : -1; + } }); }, |