From 21251a51670856194dd820bb55d7d5ae4ec11095 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Tue, 21 Jan 2025 13:25:45 +0100 Subject: [PATCH 1/2] fix: init --- src/components/UserPanel.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/UserPanel.vue b/src/components/UserPanel.vue index a0ef73a1f..110828f55 100644 --- a/src/components/UserPanel.vue +++ b/src/components/UserPanel.vue @@ -22,6 +22,7 @@ const { t, locale } = useI18n(); const { copyText } = useClipboard(); const { notify } = useNotify(); +const langList = import.meta.glob('../../node_modules/quasar/lang/*.js'); const userLocale = computed({ get() { return locale.value; @@ -32,8 +33,7 @@ const userLocale = computed({ value = localeEquivalence[value] ?? value; try { - /* @vite-ignore */ - import(`../../node_modules/quasar/lang/${value}.mjs`).then((lang) => { + langList[`../../node_modules/quasar/lang/${value}.js`]().then((lang) => { Quasar.lang.set(lang.default); }); } catch (error) { From 00cea34ddef406bf937a1202795a2eb90ac436d2 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Tue, 21 Jan 2025 13:55:20 +0100 Subject: [PATCH 2/2] perf: use util in OutLayout --- src/components/UserPanel.vue | 14 +++++--------- src/layouts/OutLayout.vue | 15 ++++----------- src/utils/quasarLang.js | 12 ++++++++++++ 3 files changed, 21 insertions(+), 20 deletions(-) create mode 100644 src/utils/quasarLang.js diff --git a/src/components/UserPanel.vue b/src/components/UserPanel.vue index 110828f55..5f3266eb2 100644 --- a/src/components/UserPanel.vue +++ b/src/components/UserPanel.vue @@ -1,6 +1,9 @@