From 3d85a3cfcda978c25516c630a2694a220ca23407 Mon Sep 17 00:00:00 2001 From: Michael Genson <71845777+michael-genson@users.noreply.github.com> Date: Sun, 20 Jul 2025 18:38:09 +0000 Subject: [PATCH] simplify plugin and include useHead attrs --- frontend/composables/use-locales/use-locales.ts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/frontend/composables/use-locales/use-locales.ts b/frontend/composables/use-locales/use-locales.ts index 6dcf27851..515dfa570 100644 --- a/frontend/composables/use-locales/use-locales.ts +++ b/frontend/composables/use-locales/use-locales.ts @@ -3,9 +3,7 @@ import { LOCALES } from "./available-locales"; export const useLocales = () => { const i18n = useI18n(); - - const { isRtl } = useRtl(); - const { current: vuetifyLocale } = useLocale(); + const { current: vuetifyLocale, isRtl } = useLocale(); const locale = computed({ get: () => i18n.locale.value, @@ -16,13 +14,17 @@ export const useLocales = () => { // auto update vuetify locale watch(locale, (lc) => { vuetifyLocale.value = lc; - }); - // auto update rtl - watch(vuetifyLocale, (vl) => { - const currentLocale = LOCALES.find(lc => lc.value === vl); + const currentLocale = LOCALES.find(lc => lc.value === vuetifyLocale.value); if (currentLocale) { isRtl.value = currentLocale.dir === "rtl"; } + + useHead({ + htmlAttrs: { + lang: lc, + dir: isRtl.value ? "rtl" : "ltr", + }, + }) }); return {