mirror of
https://gitlab.com/bramw/baserow.git
synced 2025-04-30 15:20:01 +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
|
||
|
},
|
||
|
}
|