Fixed uneeded error when activating en_US locale
This commit is contained in:
parent
7819c60164
commit
80f0cc12e9
|
@ -335,6 +335,11 @@ export default {
|
||||||
immediate: true,
|
immediate: true,
|
||||||
handler(newValue) {
|
handler(newValue) {
|
||||||
let self = this
|
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) =>{
|
import(/* webpackChunkName: "locale-[request]" */ `./translations/${newValue}.json`).then((response) =>{
|
||||||
Vue.$translations[newValue] = response.default[newValue]
|
Vue.$translations[newValue] = response.default[newValue]
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
|
@ -343,9 +348,6 @@ export default {
|
||||||
self.$language.current = 'noop'
|
self.$language.current = 'noop'
|
||||||
self.$language.current = newValue
|
self.$language.current = newValue
|
||||||
})
|
})
|
||||||
if (newValue === 'en_US') {
|
|
||||||
return self.$store.commit('ui/momentLocale', 'en')
|
|
||||||
}
|
|
||||||
let momentLocale = newValue.replace('_', '-').toLowerCase()
|
let momentLocale = newValue.replace('_', '-').toLowerCase()
|
||||||
import(/* webpackChunkName: "moment-locale-[request]" */ `moment/locale/${momentLocale}.js`).then(() => {
|
import(/* webpackChunkName: "moment-locale-[request]" */ `moment/locale/${momentLocale}.js`).then(() => {
|
||||||
self.$store.commit('ui/momentLocale', momentLocale)
|
self.$store.commit('ui/momentLocale', momentLocale)
|
||||||
|
|
Loading…
Reference in New Issue