From b3fbfe2d9d665c3a8a7619bd4aebff9ea2d025ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=A5=E6=B5=A9?= Date: Thu, 30 Oct 2025 22:43:38 +0800 Subject: [PATCH] =?UTF-8?q?feat(i18n):=20=E6=B7=BB=E5=8A=A0=E8=AF=AD?= =?UTF-8?q?=E8=A8=80=E5=8F=98=E6=9B=B4=E6=97=B6=E6=9B=B4=E6=96=B0html=20la?= =?UTF-8?q?ng=E5=B1=9E=E6=80=A7=E7=9A=84=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/locales-utils/i18n-auto-imports.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/locales-utils/i18n-auto-imports.ts b/src/locales-utils/i18n-auto-imports.ts index 339c5a8..8848025 100644 --- a/src/locales-utils/i18n-auto-imports.ts +++ b/src/locales-utils/i18n-auto-imports.ts @@ -7,6 +7,9 @@ import messages from '@intlify/unplugin-vue-i18n/messages'; import { createI18n } from 'vue-i18n'; const locale = useLocalStorage('app-locale', navigator.language); +watchEffect(() => { + window.document.documentElement.setAttribute('lang', locale.value); +}); // https://vue-i18n.intlify.dev/guide/essentials/started.html#registering-the-i18n-plugin export const i18nInstance = createI18n({