Detección de idioma de navegador mejorada

This commit is contained in:
Juan Ferrer Toribio 2017-01-18 13:10:39 +01:00
parent 3c83bed5b3
commit a6f7c1f140
2 changed files with 13 additions and 6 deletions

2
debian/changelog vendored
View File

@ -1,4 +1,4 @@
hedera-web (1.390-deb8) stable; urgency=low
hedera-web (1.391-deb8) stable; urgency=low
* Initial Release.

View File

@ -10,11 +10,18 @@ module.exports =
,init: function ()
{
if (!this.language)
{
var language = navigator.language.substr (0, 2);
this.language = language ? language : 'en';
}
if (this.language)
return;
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)