diff options
Diffstat (limited to 'client/lib')
-rw-r--r-- | client/lib/i18n.js | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/client/lib/i18n.js b/client/lib/i18n.js index 34a789e1..4c02211a 100644 --- a/client/lib/i18n.js +++ b/client/lib/i18n.js @@ -6,10 +6,16 @@ Meteor.startup(() => { Tracker.autorun(() => { const currentUser = Meteor.user(); let language; - if (currentUser && currentUser.profile && currentUser.profile.language) { - language = currentUser.profile.language; - } else { - language = navigator.language || navigator.userLanguage; + if (currentUser) { + language = currentUser.profile && currentUser.profile.language; + } + + if (!language) { + if(navigator.languages) { + language = navigator.languages[0]; + } else { + language = navigator.language || navigator.userLanguage; + } } if (language) { |