diff options
author | Phil Hughes <me@iamphill.com> | 2017-04-18 18:29:22 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-04-18 18:29:22 +0300 |
commit | 372841975feace348ffdcc14819b9c9a9da8b181 (patch) | |
tree | e14eceb2a45b3c0423eb2767a3147736cf18561f | |
parent | b0df1ed4884a16c5c45800031667e0dd3251c978 (diff) |
Default the language to en - more useful for specs
-rw-r--r-- | app/assets/javascripts/locale/index.js | 2 | ||||
-rw-r--r-- | spec/javascripts/cycle_analytics/limit_warning_component_spec.js | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/app/assets/javascripts/locale/index.js b/app/assets/javascripts/locale/index.js index 0feb9eb5d43..56791968e53 100644 --- a/app/assets/javascripts/locale/index.js +++ b/app/assets/javascripts/locale/index.js @@ -9,7 +9,7 @@ const locales = { en, }; -const lang = document.querySelector('html').getAttribute('lang'); +const lang = document.querySelector('html').getAttribute('lang') || 'en'; export { lang }; export default new Jed(locales[lang]); diff --git a/spec/javascripts/cycle_analytics/limit_warning_component_spec.js b/spec/javascripts/cycle_analytics/limit_warning_component_spec.js index 50000c5a5f5..2fb9eb0ca85 100644 --- a/spec/javascripts/cycle_analytics/limit_warning_component_spec.js +++ b/spec/javascripts/cycle_analytics/limit_warning_component_spec.js @@ -1,6 +1,9 @@ import Vue from 'vue'; +import Translate from '~/vue_shared/translate'; import limitWarningComp from '~/cycle_analytics/components/limit_warning_component'; +Vue.use(Translate); + describe('Limit warning component', () => { let component; let LimitWarningComponent; |