Skip to content
Snippets Groups Projects
Commit 899972ae authored by Pierre-Jean CHANCELLIER's avatar Pierre-Jean CHANCELLIER
Browse files

keep the good language when going back in history

parent 6ad86b0b
No related branches found
No related tags found
No related merge requests found
<template>
<div>
<select class="form-control" @change="saveLocale($event)" v-model="lang">
<select class="form-control" @change="saveLocale($event)" v-model="$i18n.locale">
<option v-for="lang in $i18n.locales" :key="lang.code" :value="lang.code">{{ lang.name }}</option>
</select>
</div>
......@@ -8,14 +8,9 @@
<script>
export default {
data() {
return {
lang: this.$i18n.locale
}
},
methods: {
saveLocale(e) {
this.lang = e.target.value
this.$i18n.locale = e.target.value
this.$i18n.setLocaleCookie(e.target.value)
this.$router.push(this.switchLocalePath(e.target.value))
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment