mirror of
https://github.com/wekan/wekan.git
synced 2026-02-18 14:08:06 +01:00
Fix language auto-detection
This commit is contained in:
parent
566527dfad
commit
8f43b74bbc
3 changed files with 17 additions and 3 deletions
|
|
@ -16,6 +16,15 @@ Meteor.startup(() => {
|
|||
navigator.userLanguage,
|
||||
].filter(Boolean);
|
||||
if (language) {
|
||||
TAPi18n.setLanguage(language);
|
||||
// Try with potentially complex language tag
|
||||
if (TAPi18n.isLanguageSupported(language)) {
|
||||
TAPi18n.setLanguage(language);
|
||||
} else if (language.includes('-')) {
|
||||
// Fallback to a general language
|
||||
const [general] = language.split('-');
|
||||
if (TAPi18n.isLanguageSupported(general)) {
|
||||
TAPi18n.setLanguage(general);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue