mirror of
https://github.com/wekan/wekan.git
synced 2025-04-23 13:37:09 -04:00
Sort available languages by their translated names
This commit is contained in:
parent
cdddf42847
commit
a9dde296bf
2 changed files with 22 additions and 6 deletions
|
@ -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;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue