From f5572892746019bdfa54bfd521dc5acd8e4d6647 Mon Sep 17 00:00:00 2001 From: advplyr Date: Tue, 25 Apr 2023 19:00:57 -0500 Subject: [PATCH] Update:Set lang in HTML tag #1399 --- client/layouts/default.vue | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/client/layouts/default.vue b/client/layouts/default.vue index 8c9316fa..b201fc4a 100644 --- a/client/layouts/default.vue +++ b/client/layouts/default.vue @@ -569,6 +569,7 @@ export default { changeLanguage(code) { console.log('Changed lang', code) this.currentLang = code + document.documentElement.lang = code } }, beforeMount() { @@ -593,6 +594,11 @@ export default { this.$toast.error(this.$route.query.error) this.$router.replace(this.$route.path) } + + // Set lang on HTML tag + if (this.$languageCodes?.current) { + document.documentElement.lang = this.$languageCodes.current + } }, beforeDestroy() { this.$eventBus.$off('change-lang', this.changeLanguage)