Update:Set lang in HTML tag #1399

This commit is contained in:
advplyr 2023-04-25 19:00:57 -05:00
parent a5627a1b52
commit f557289274

View File

@ -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)