diff --git a/index.html b/index.html index 1506caa..3ceea3f 100644 --- a/index.html +++ b/index.html @@ -1,12 +1,6 @@ - - + Calendar - - - -
- - - + +
\ No newline at end of file diff --git a/src/App.vue b/src/App.vue index 5836a2c..4c0fe18 100644 --- a/src/App.vue +++ b/src/App.vue @@ -3,6 +3,7 @@ import { ref, onMounted, onBeforeUnmount } from 'vue' import CalendarView from './components/CalendarView.vue' import EventDialog from './components/EventDialog.vue' import { useCalendarStore } from './stores/CalendarStore' +import { lang } from './utils/locale' const eventDialog = ref(null) const calendarStore = useCalendarStore() @@ -35,6 +36,8 @@ function handleGlobalKey(e) { onMounted(() => { calendarStore.initializeHolidaysFromConfig() document.addEventListener('keydown', handleGlobalKey, { passive: false }) + // Set document language via shared util + if (lang) document.documentElement.setAttribute('lang', lang) }) onBeforeUnmount(() => { diff --git a/src/components/CalendarView.vue b/src/components/CalendarView.vue index 387f5d7..aa57e68 100644 --- a/src/components/CalendarView.vue +++ b/src/components/CalendarView.vue @@ -13,6 +13,7 @@ import { daysInclusive, addDaysStr, MIN_YEAR, MAX_YEAR } from '@/utils/date' import { toLocalString, fromLocalString, DEFAULT_TZ } from '@/utils/date' import { addDays, differenceInWeeks } from 'date-fns' import { createVirtualWeekManager } from '@/plugins/virtualWeeks' +import { rtl } from '@/utils/locale' const calendarStore = useCalendarStore() const emit = defineEmits(['create-event', 'edit-event']) @@ -433,7 +434,7 @@ window.addEventListener('resize', () => {