Deteccion idioma del navedor mejorada
This commit is contained in:
parent
969f58981e
commit
1a5bcf2bd2
|
@ -10,11 +10,18 @@ module.exports =
|
||||||
|
|
||||||
,init: function ()
|
,init: function ()
|
||||||
{
|
{
|
||||||
if (!this.language)
|
if (this.language)
|
||||||
{
|
return;
|
||||||
var language = navigator.language.substr (0, 2);
|
|
||||||
this.language = language ? language : 'en';
|
var language = 'en';
|
||||||
}
|
var languages = navigator.languages;
|
||||||
|
|
||||||
|
if (languages && languages.length > 0)
|
||||||
|
language = languages[0];
|
||||||
|
else if (navigator.language)
|
||||||
|
language = navigator.language;
|
||||||
|
|
||||||
|
this.language = language.substr (0, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
,load: function (path, callback)
|
,load: function (path, callback)
|
||||||
|
|
Loading…
Reference in New Issue