summaryrefslogtreecommitdiffstats
path: root/client/lib/i18n.js
diff options
context:
space:
mode:
authorMaxime Quandalle <maxime@quandalle.com>2015-09-03 23:12:46 +0200
committerMaxime Quandalle <maxime@quandalle.com>2015-09-03 23:12:46 +0200
commitb3851817ecd59b039f2c2228d08a1c6fd8e60d60 (patch)
tree82a50f69788d5c20632f3ec9c7d3e136502b93b4 /client/lib/i18n.js
parent039cfe7edf8faf901069a94b3ca9b66f7973b26a (diff)
downloadwekan-b3851817ecd59b039f2c2228d08a1c6fd8e60d60.tar.gz
wekan-b3851817ecd59b039f2c2228d08a1c6fd8e60d60.tar.bz2
wekan-b3851817ecd59b039f2c2228d08a1c6fd8e60d60.zip
Enforce a consistent ES6 coding style
Replace the old (and broken) jshint + jscsrc by eslint and configure it to support some of the ES6 features. The command `eslint` currently has one error which is a bug that was discovered by its static analysis and should be fixed (usage of a dead object).
Diffstat (limited to 'client/lib/i18n.js')
-rw-r--r--client/lib/i18n.js9
1 files changed, 4 insertions, 5 deletions
diff --git a/client/lib/i18n.js b/client/lib/i18n.js
index 7d7e3ebb..a03fb398 100644
--- a/client/lib/i18n.js
+++ b/client/lib/i18n.js
@@ -2,9 +2,9 @@
// the language reactively. If the user is not connected we use the language
// information provided by the browser, and default to english.
-Tracker.autorun(function() {
- var language;
- var currentUser = Meteor.user();
+Tracker.autorun(() => {
+ const currentUser = Meteor.user();
+ let language;
if (currentUser) {
language = currentUser.profile && currentUser.profile.language;
} else {
@@ -12,11 +12,10 @@ Tracker.autorun(function() {
}
if (language) {
-
TAPi18n.setLanguage(language);
// XXX
- var shortLanguage = language.split('-')[0];
+ const shortLanguage = language.split('-')[0];
T9n.setLanguage(shortLanguage);
}
});