Add support for three-letter lang codes
This commit is contained in:
parent
0c9178d392
commit
04b65a0b4e
|
@ -122,7 +122,7 @@ window.html10n = (function(window, document, undefined) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!data[lang]) lang = lang.substr(0,2)
|
if (!data[lang]) lang = lang.substr(0, lang.indexOf('-') == -1? lang.length : lang.indexOf('-'))
|
||||||
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
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
(function(document) {
|
(function(document) {
|
||||||
// Set language for l10n
|
// Set language for l10n
|
||||||
var language = document.cookie.match(/language=(\w{2})/);
|
var language = document.cookie.match(/language=(\w{2,3})(-w+)?/);
|
||||||
if(language) language = language[1];
|
if(language) language = language[1];
|
||||||
|
|
||||||
html10n.bind('indexed', function() {
|
html10n.bind('indexed', function() {
|
||||||
|
|
Loading…
Reference in New Issue