From 2685d0f72005da619c61da4ff58a37ce857e34c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodolphe=20Br=C3=A9ard?= Date: Fri, 25 Aug 2023 10:36:47 +0200 Subject: [PATCH] Set the HTML lang attribute to the appropriate language --- CHANGELOG.md | 1 + src/main.js | 1 + src/views/ConfigView.vue | 1 + 3 files changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b6c0313..4add200 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Secret keys are now restricted to 128 bits (16 bytes) or 256 bits (32 bytes) - The local part cannot contain the separator +- The HTML lang attribute is now set to the appropriate language ## [0.2.0] - 2023-08-11 diff --git a/src/main.js b/src/main.js index 251f552..46bdeb2 100644 --- a/src/main.js +++ b/src/main.js @@ -12,6 +12,7 @@ const stored_locale = useStorage('sake-locale', ''); if (!stored_locale.value) { stored_locale.value = default_locale; } +document.documentElement.setAttribute('lang', stored_locale.value); const i18n = createI18n({ legacy: false, diff --git a/src/views/ConfigView.vue b/src/views/ConfigView.vue index e5ebd35..29e17c8 100644 --- a/src/views/ConfigView.vue +++ b/src/views/ConfigView.vue @@ -15,6 +15,7 @@ const toMainView = () => { watch(locale, async (newLocale) => { stored_locale.value = newLocale; + document.documentElement.setAttribute('lang', newLocale); });