Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
webui: use a failback if browser language detection fails, fixes #3805
  • Loading branch information
Mark Clarkstone authored and perexg committed May 17, 2016
1 parent 7985a96 commit 5dfc7d5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/webui/static/app/tvheadend.js
Expand Up @@ -12,6 +12,12 @@ tvheadend.doc_history = [];
tvheadend.doc_win = null;
tvheadend.language = window.navigator.userLanguage || window.navigator.language;

// Use en-US if browser language detection fails.
if (!tvheadend.language || !/\S/.test(tvheadend.language)) {
console.log('No browser language detected, using hard-coded en-US.');
tvheadend.language = "en-US";
}

tvheadend.cookieProvider = new Ext.state.CookieProvider({
// 7 days from now
expires: new Date(new Date().getTime() + (1000 * 60 * 60 * 24 * 7))
Expand Down

0 comments on commit 5dfc7d5

Please sign in to comment.