Skip to content

Commit

Permalink
Update client/src/www/ui_components/app-root.js
Browse files Browse the repository at this point in the history
Co-authored-by: Vinicius Fortuna <[email protected]>
  • Loading branch information
daniellacosse and fortuna authored Apr 4, 2024
1 parent 635ebde commit 904fd72
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions client/src/www/ui_components/app-root.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,21 +80,19 @@ function getBrowserLanguages() {
return [navigator.language];
}

window.OutlineI18n = {
getBestMatchingLanguage(available) {
const lookUpAvailable = makeLookUpLanguage(available);
for (const candidate of getBrowserLanguages()) {
const parts = candidate.split('-');
while (parts.length) {
const joined = parts.join('-');
const closest = lookUpAvailable(joined);
if (closest) {
return closest;
}
parts.pop();
function getBestMatchingLanguage(available) {
const lookUpAvailable = makeLookUpLanguage(available);
for (const candidate of getBrowserLanguages()) {
const parts = candidate.split('-');
while (parts.length) {
const joined = parts.join('-');
const closest = lookUpAvailable(joined);
if (closest) {
return closest;
}
parts.pop();
}
},
}
};

// Workaround:
Expand Down

0 comments on commit 904fd72

Please sign in to comment.