mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
In case of language switch success change language in store.
This commit is contained in:
parent
a404be1cfb
commit
8a5b552a11
@ -23,13 +23,13 @@
|
|||||||
<b>{{ $t('language') }}</b>
|
<b>{{ $t('language') }}</b>
|
||||||
</small>
|
</small>
|
||||||
</b-col>
|
</b-col>
|
||||||
<b-col class="col-12">{{ $store.state.language }}</b-col>
|
<b-col class="col-12">{{ $t(buildLanguage()) }}</b-col>
|
||||||
</b-row>
|
</b-row>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<div>
|
<div>
|
||||||
<b-form @submit.stop.prevent="handleSubmit(onSubmit)">
|
<b-form @submit.stop.prevent="onSubmit">
|
||||||
<b-row class="mb-2">
|
<b-row class="mb-2">
|
||||||
<b-col class="col-12">
|
<b-col class="col-12">
|
||||||
<small>
|
<small>
|
||||||
@ -93,17 +93,22 @@ export default {
|
|||||||
.query({
|
.query({
|
||||||
query: updateUserInfos,
|
query: updateUserInfos,
|
||||||
variables: {
|
variables: {
|
||||||
email: this.$store.email,
|
email: this.$store.state.email,
|
||||||
language: this.$store.state.language,
|
locale: this.language,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
this.$store.commit('language', this.language)
|
||||||
this.cancelEdit()
|
this.cancelEdit()
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
this.$toasted.error(error.message)
|
this.$toasted.error(error.message)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
buildLanguage() {
|
||||||
|
return 'languages.' + this.$store.state.language
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user