mirror of
https://github.com/wekan/wekan.git
synced 2025-04-23 21:47:10 -04:00
Use the navigator's language properties even if a user exists but the user has not yet choosen a profile language. If the browser provides multiple preferred languages via navigator.languages
, select the most-preferred one.
WKN-47
This commit is contained in:
parent
b90d668fbc
commit
82a5da61df
1 changed files with 8 additions and 2 deletions
|
@ -7,8 +7,14 @@ Tracker.autorun(() => {
|
|||
let language;
|
||||
if (currentUser) {
|
||||
language = currentUser.profile && currentUser.profile.language;
|
||||
} else {
|
||||
language = navigator.language || navigator.userLanguage;
|
||||
}
|
||||
|
||||
if (!language) {
|
||||
if(navigator.languages) {
|
||||
language = navigator.languages[0];
|
||||
} else {
|
||||
language = navigator.language || navigator.userLanguage;
|
||||
}
|
||||
}
|
||||
|
||||
if (language) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue