Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:iquidus/etherpad-lite into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
iquidus committed Apr 24, 2020
2 parents bd15d5c + 3a0a050 commit 981d375
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/static/js/html10n.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ window.html10n = (function(window, document, undefined) {

// Check if lang exists
if (!data[lang]) {
<<<<<<< HEAD
// lang not found
// This may be due to formatting (expected 'ru' but browser sent 'ru-RU')
// Set err msg before mutating lang (we may need this later)
Expand All @@ -203,6 +204,20 @@ window.html10n = (function(window, document, undefined) {
lang = l // set lang to ROOT-VARIANT (e.g 'zh-hans')
break;
}
=======
if (lang.indexOf('-') > -1) {
var msg = 'Couldn\'t find translations for '+lang
lang = lang.split('-')[0] // get root locale incase variant (e.g ru-RU)
if (!data[lang]) { // check root locale (e.g ru)
var l
for(l in data) { // try similar (e.g zh-hans)
if(lang != l && l.indexOf(lang) === 0 && data[l]) {
lang = l
break;
}
}
if(lang != l) return cb(new Error(msg))
>>>>>>> 3a0a050af45316b70c0b1a3e0412b870eb0d7b4d
}
// Did we find a variant? If not, return err.
if(lang != l) return cb(new Error(msg))
Expand Down

0 comments on commit 981d375

Please sign in to comment.