diff options
author | Lauri Ojansivu <x@xet7.org> | 2017-06-19 01:45:06 +0300 |
---|---|---|
committer | Lauri Ojansivu <x@xet7.org> | 2017-06-19 01:45:06 +0300 |
commit | 183142a8b44cb8d227f4758c8733b36d81de4e51 (patch) | |
tree | 5b8b199ed0e5c16c7b900a34e5ae4619ea54722f | |
parent | cdddf42847c49a0dbdfa83c3b9bcd536a7434f49 (diff) | |
parent | 9b9b208169ab212348aa553a447febc8d4445ef0 (diff) | |
download | wekan-183142a8b44cb8d227f4758c8733b36d81de4e51.tar.gz wekan-183142a8b44cb8d227f4758c8733b36d81de4e51.tar.bz2 wekan-183142a8b44cb8d227f4758c8733b36d81de4e51.zip |
Merge branch 'GhassenRjab-sort-languges-tr' into devel
Sort languages by their translated names. Thanks to GhassenRjab !
-rw-r--r-- | CHANGELOG.md | 3 | ||||
-rw-r--r-- | client/components/main/layouts.js | 14 | ||||
-rw-r--r-- | client/components/users/userHeader.js | 14 |
3 files changed, 24 insertions, 7 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f2e470d..f928a80f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,8 @@ This release adds the following new features: * [Change the way to delete a list (card-like)](https://github.com/wekan/wekan/pull/1050), fixes [missing undo button](https://github.com/wekan/wekan/issues/1023); * [When deleting list, delete list's cards too](https://github.com/wekan/wekan/pull/1054); -* [Re-enable Export Wekan Board](https://github.com/wekan/wekan/pull/1059). +* [Re-enable Export Wekan Board](https://github.com/wekan/wekan/pull/1059); +* [Sort languages by their translated names](https://github.com/wekan/wekan/pull/1070). and fixes the following bugs: diff --git a/client/components/main/layouts.js b/client/components/main/layouts.js index 1e50b01a..3b9092c3 100644 --- a/client/components/main/layouts.js +++ b/client/components/main/layouts.js @@ -20,9 +20,17 @@ Template.userFormsLayout.onRendered(() => { Template.userFormsLayout.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; + } }); }, 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; + } }); }, |