Skip to content

Commit

Permalink
fix(lang): check two first characters of browser language (#152)
Browse files Browse the repository at this point in the history
  • Loading branch information
kcmr authored and jorgecasar committed Oct 16, 2016
1 parent 128a5d7 commit a819126
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
};

var lang = navigator.language || navigator.userLanguage || document.documentElement.lang;
if (['en','es'].indexOf(lang) === -1) {
if (['en','es'].indexOf(lang.substring(0,2)) === -1) {
lang = 'en';
}
document.documentElement.lang = lang;
Expand Down

0 comments on commit a819126

Please sign in to comment.