change the language of the HTML document dynamically
This commit is contained in:
parent
a506e0245d
commit
e636ee513e
@ -79,7 +79,8 @@ export default {
|
|||||||
// window.open(`${window.location.origin}/help`, '_blank')
|
// window.open(`${window.location.origin}/help`, '_blank')
|
||||||
},
|
},
|
||||||
storeLangPref() {
|
storeLangPref() {
|
||||||
localStorage.setItem('lang', this.$i18n.locale)
|
localStorage.setItem('lang', this.$i18n.locale);
|
||||||
|
document.documentElement.lang = this.$i18n.locale;
|
||||||
},
|
},
|
||||||
async update() {
|
async update() {
|
||||||
this.showUpdateUI = false;
|
this.showUpdateUI = false;
|
||||||
@ -108,7 +109,8 @@ export default {
|
|||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
if (localStorage.getItem('lang'))
|
if (localStorage.getItem('lang'))
|
||||||
this.$i18n.locale = localStorage.getItem('lang')
|
this.$i18n.locale = localStorage.getItem('lang');
|
||||||
|
document.documentElement.lang = this.$i18n.locale;
|
||||||
this.detectColorScheme()
|
this.detectColorScheme()
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
Loading…
Reference in New Issue
Block a user