diff --git a/theme/src/client/composables/layout.ts b/theme/src/client/composables/layout.ts index f17e02b1..21133e7e 100644 --- a/theme/src/client/composables/layout.ts +++ b/theme/src/client/composables/layout.ts @@ -90,6 +90,7 @@ export function registerWatchers() { }, { passive: true }) } + const { lang } = useData() const route = useRoute() const { disableSidebar, toggleSidebarCollapse } = useSidebarControl() watch(() => route.path, () => { @@ -97,5 +98,11 @@ export function registerWatchers() { toggleSidebarCollapse(false) }) + if (inBrowser) { + watch(lang, (newLang) => { + document.documentElement.lang = newLang + }, { immediate: true }) + } + useCloseSidebarOnEscape() }