Skip to content
Snippets Groups Projects
Verified Commit 80f0cc12 authored by Eliot Berriot's avatar Eliot Berriot
Browse files

Fixed uneeded error when activating en_US locale

parent 7819c601
No related branches found
No related tags found
No related merge requests found
......@@ -335,6 +335,11 @@ export default {
immediate: true,
handler(newValue) {
let self = this
if (newValue === 'en_US') {
self.$language.current = 'noop'
self.$language.current = newValue
return self.$store.commit('ui/momentLocale', 'en')
}
import(/* webpackChunkName: "locale-[request]" */ `./translations/${newValue}.json`).then((response) =>{
Vue.$translations[newValue] = response.default[newValue]
}).finally(() => {
......@@ -343,9 +348,6 @@ export default {
self.$language.current = 'noop'
self.$language.current = newValue
})
if (newValue === 'en_US') {
return self.$store.commit('ui/momentLocale', 'en')
}
let momentLocale = newValue.replace('_', '-').toLowerCase()
import(/* webpackChunkName: "moment-locale-[request]" */ `moment/locale/${momentLocale}.js`).then(() => {
self.$store.commit('ui/momentLocale', momentLocale)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment