summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/locale
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/locale')
-rw-r--r--app/assets/javascripts/locale/index.js5
1 files changed, 2 insertions, 3 deletions
diff --git a/app/assets/javascripts/locale/index.js b/app/assets/javascripts/locale/index.js
index 7ba676d6d20..6a5084efeb8 100644
--- a/app/assets/javascripts/locale/index.js
+++ b/app/assets/javascripts/locale/index.js
@@ -16,9 +16,8 @@ const locales = allLocales.reduce((d, obj) => {
return data;
}, {});
-let lang = document.querySelector('html').getAttribute('lang') || 'en';
-lang = lang.replace(/-/g, '_');
-
+const langAttribute = document.querySelector('html').getAttribute('lang');
+const lang = (langAttribute || 'en').replace(/-/g, '_');
const locale = new Jed(locales[lang]);
/**