mirror of
https://gitlab.com/bramw/baserow.git
synced 2024-11-21 23:37:55 +00:00
19 lines
447 B
JavaScript
19 lines
447 B
JavaScript
/**
|
|
* This mixin forces language detection based on the browser settings instead of the
|
|
* language stored in the nuxt-i18n cookie.
|
|
*/
|
|
export default {
|
|
data() {
|
|
return {
|
|
originalLanguageBeforeDetect: null,
|
|
}
|
|
},
|
|
created() {
|
|
this.originalLanguageBeforeDetect = this.$i18n.locale
|
|
this.$i18n.locale = this.$i18n.getBrowserLocale()
|
|
},
|
|
beforeDestroy() {
|
|
this.$i18n.locale = this.originalLanguageBeforeDetect
|
|
},
|
|
}
|