aboutsummaryrefslogtreecommitdiffstats
path: root/src/js
diff options
context:
space:
mode:
Diffstat (limited to 'src/js')
-rw-r--r--src/js/captions.js7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/js/captions.js b/src/js/captions.js
index 4ad2a956..f31b5305 100644
--- a/src/js/captions.js
+++ b/src/js/captions.js
@@ -83,11 +83,8 @@ const captions = {
// * active: The state preferred by user settings or config
// * toggled: The real captions state
- const languages = dedupe(
- Array.from(navigator.languages || navigator.language || navigator.userLanguage).map(
- language => language.split('-')[0],
- ),
- );
+ const browserLanguages = navigator.languages || [navigator.language || navigator.userLanguage || 'en'];
+ const languages = dedupe(browserLanguages.map(language => language.split('-')[0]));
let language = (this.storage.get('language') || this.config.captions.language || 'auto').toLowerCase();