From 498e9ab2324b389e930effaf8d3721c906f0d6f0 Mon Sep 17 00:00:00 2001 From: Elia Bieri Date: Thu, 25 May 2023 14:24:39 +0200 Subject: [PATCH 1/2] Set dayjs locale --- client/src/main.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client/src/main.ts b/client/src/main.ts index df15ebee..621bc22d 100644 --- a/client/src/main.ts +++ b/client/src/main.ts @@ -1,4 +1,6 @@ import * as Sentry from "@sentry/vue"; +import dayjs from "dayjs"; +import "dayjs/locale/de"; import * as log from "loglevel"; import { createPinia } from "pinia"; import { createApp, markRaw } from "vue"; @@ -37,8 +39,10 @@ Sentry.init({ }); // todo: define lang setup -loadLocaleMessages("de").then(() => { +const locale = "de"; +loadLocaleMessages(locale).then(() => { app.use(router); + dayjs.locale(locale); const pinia = createPinia(); pinia.use(({ store }) => { From f8e309e42414cc04058fda64af27ef733faaf08c Mon Sep 17 00:00:00 2001 From: Elia Bieri Date: Fri, 26 May 2023 10:25:49 +0200 Subject: [PATCH 2/2] Fix language switching --- client/src/main.ts | 6 +----- .../attendanceCourse/AttendanceCourse.vue | 4 +--- client/src/stores/user.ts | 12 ++++++++++++ 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/client/src/main.ts b/client/src/main.ts index 621bc22d..df15ebee 100644 --- a/client/src/main.ts +++ b/client/src/main.ts @@ -1,6 +1,4 @@ import * as Sentry from "@sentry/vue"; -import dayjs from "dayjs"; -import "dayjs/locale/de"; import * as log from "loglevel"; import { createPinia } from "pinia"; import { createApp, markRaw } from "vue"; @@ -39,10 +37,8 @@ Sentry.init({ }); // todo: define lang setup -const locale = "de"; -loadLocaleMessages(locale).then(() => { +loadLocaleMessages("de").then(() => { app.use(router); - dayjs.locale(locale); const pinia = createPinia(); pinia.use(({ store }) => { diff --git a/client/src/pages/learningPath/learningContentPage/attendanceCourse/AttendanceCourse.vue b/client/src/pages/learningPath/learningContentPage/attendanceCourse/AttendanceCourse.vue index 615ccc80..2373d00e 100644 --- a/client/src/pages/learningPath/learningContentPage/attendanceCourse/AttendanceCourse.vue +++ b/client/src/pages/learningPath/learningContentPage/attendanceCourse/AttendanceCourse.vue @@ -19,7 +19,6 @@