Fix html10n cache and lang fallback
This commit is contained in:
parent
e3f9ed37b4
commit
a2b2257851
1 changed files with 2 additions and 2 deletions
|
@ -92,8 +92,7 @@ window.html10n = (function(window, document, undefined) {
|
||||||
var that = this
|
var that = this
|
||||||
|
|
||||||
if (this.cache[href]) {
|
if (this.cache[href]) {
|
||||||
this.parse(this.cache[href])
|
this.parse(lang, this.cache[href], cb)
|
||||||
cb()
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -123,6 +122,7 @@ window.html10n = (function(window, document, undefined) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!data[lang]) lang = lang.substr(0,2)
|
||||||
if (!data[lang]) {
|
if (!data[lang]) {
|
||||||
cb(new Error('Couldn\'t find translations for '+lang))
|
cb(new Error('Couldn\'t find translations for '+lang))
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue