Merge branch 'GhassenRjab-sort-languges-tr' into devel

Sort languages by their translated names. Thanks to GhassenRjab !
This commit is contained in:
Lauri Ojansivu 2017-06-19 01:45:06 +03:00
commit 183142a8b4
3 changed files with 24 additions and 7 deletions

View file

@ -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:

View file

@ -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;
}
});
},

View file

@ -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;
}
});
},