From 80f0cc12e952256a03a2e0d6f44a80ac852fa996 Mon Sep 17 00:00:00 2001 From: Eliot Berriot Date: Tue, 25 Feb 2020 15:50:00 +0100 Subject: [PATCH] Fixed uneeded error when activating en_US locale --- front/src/App.vue | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/front/src/App.vue b/front/src/App.vue index b6bec0ede..648f4cb94 100644 --- a/front/src/App.vue +++ b/front/src/App.vue @@ -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)