mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-01-03 00:06:46 +01:00
Update:Set lang in HTML tag #1399
This commit is contained in:
parent
a5627a1b52
commit
f557289274
@ -569,6 +569,7 @@ export default {
|
|||||||
changeLanguage(code) {
|
changeLanguage(code) {
|
||||||
console.log('Changed lang', code)
|
console.log('Changed lang', code)
|
||||||
this.currentLang = code
|
this.currentLang = code
|
||||||
|
document.documentElement.lang = code
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
beforeMount() {
|
beforeMount() {
|
||||||
@ -593,6 +594,11 @@ export default {
|
|||||||
this.$toast.error(this.$route.query.error)
|
this.$toast.error(this.$route.query.error)
|
||||||
this.$router.replace(this.$route.path)
|
this.$router.replace(this.$route.path)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Set lang on HTML tag
|
||||||
|
if (this.$languageCodes?.current) {
|
||||||
|
document.documentElement.lang = this.$languageCodes.current
|
||||||
|
}
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
this.$eventBus.$off('change-lang', this.changeLanguage)
|
this.$eventBus.$off('change-lang', this.changeLanguage)
|
||||||
|
Loading…
Reference in New Issue
Block a user