mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 15:30:13 +01:00
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).
21 lines
625 B
JavaScript
21 lines
625 B
JavaScript
// We save the user language preference in the user profile, and use that to set
|
|
// the language reactively. If the user is not connected we use the language
|
|
// information provided by the browser, and default to english.
|
|
|
|
Tracker.autorun(() => {
|
|
const currentUser = Meteor.user();
|
|
let language;
|
|
if (currentUser) {
|
|
language = currentUser.profile && currentUser.profile.language;
|
|
} else {
|
|
language = navigator.language || navigator.userLanguage;
|
|
}
|
|
|
|
if (language) {
|
|
TAPi18n.setLanguage(language);
|
|
|
|
// XXX
|
|
const shortLanguage = language.split('-')[0];
|
|
T9n.setLanguage(shortLanguage);
|
|
}
|
|
});
|