summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorGhassen Rjab <rjab.ghassen@gmail.com>2018-02-26 03:17:56 +0100
committerGhassen Rjab <rjab.ghassen@gmail.com>2018-02-26 03:17:56 +0100
commitc0d33d97f2c8d4e9371a03d4ad3022df3ed64d3d (patch)
treecc728f14d8ffb367cb7b3ae453e8e2c94bf3f14e /client
parent5bdb392258bd3d3863699e5bf05b64b70f222621 (diff)
downloadwekan-c0d33d97f2c8d4e9371a03d4ad3022df3ed64d3d.tar.gz
wekan-c0d33d97f2c8d4e9371a03d4ad3022df3ed64d3d.tar.bz2
wekan-c0d33d97f2c8d4e9371a03d4ad3022df3ed64d3d.zip
Fix lint errors related to language names
Diffstat (limited to 'client')
-rw-r--r--client/components/main/layouts.js12
-rw-r--r--client/components/users/userHeader.js14
2 files changed, 18 insertions, 8 deletions
diff --git a/client/components/main/layouts.js b/client/components/main/layouts.js
index df22fc14..f12718a7 100644
--- a/client/components/main/layouts.js
+++ b/client/components/main/layouts.js
@@ -17,10 +17,14 @@ Template.userFormsLayout.onRendered(() => {
Template.userFormsLayout.helpers({
languages() {
return _.map(TAPi18n.getLanguages(), (lang, code) => {
- return {
- tag: code,
- name: lang.name === 'br' ? 'Brezhoneg' : lang.name === 'ig' ? 'Igbo' : lang.name,
- };
+ const tag = code;
+ let name = lang.name;
+ if (lang.name === 'br') {
+ name = 'Brezhoneg';
+ } else if (lang.name === 'ig') {
+ name = 'Igbo';
+ }
+ return { tag, name };
}).sort(function(a, b) {
if (a.name === b.name) {
return 0;
diff --git a/client/components/users/userHeader.js b/client/components/users/userHeader.js
index 96c8c95e..be7d4dcb 100644
--- a/client/components/users/userHeader.js
+++ b/client/components/users/userHeader.js
@@ -114,10 +114,16 @@ Template.changePasswordPopup.onRendered(function () {
Template.changeLanguagePopup.helpers({
languages() {
return _.map(TAPi18n.getLanguages(), (lang, code) => {
- return {
- tag: code,
- name: lang.name === 'br' ? 'Brezhoneg' : lang.name === 'ig' ? 'Igbo' : lang.name,
- };
+ // Same code in /client/components/main/layouts.js
+ // TODO : Make code reusable
+ const tag = code;
+ let name = lang.name;
+ if (lang.name === 'br') {
+ name = 'Brezhoneg';
+ } else if (lang.name === 'ig') {
+ name = 'Igbo';
+ }
+ return { tag, name };
}).sort(function (a, b) {
if (a.name === b.name) {
return 0;