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>
|
||||
</small>
|
||||
</b-col>
|
||||
<b-col class="col-12">{{ $store.state.language }}</b-col>
|
||||
<b-col class="col-12">{{ $t(buildLanguage()) }}</b-col>
|
||||
</b-row>
|
||||
</div>
|
||||
|
||||
<div v-else>
|
||||
<div>
|
||||
<b-form @submit.stop.prevent="handleSubmit(onSubmit)">
|
||||
<b-form @submit.stop.prevent="onSubmit">
|
||||
<b-row class="mb-2">
|
||||
<b-col class="col-12">
|
||||
<small>
|
||||
@ -93,17 +93,22 @@ export default {
|
||||
.query({
|
||||
query: updateUserInfos,
|
||||
variables: {
|
||||
email: this.$store.email,
|
||||
language: this.$store.state.language,
|
||||
email: this.$store.state.email,
|
||||
locale: this.language,
|
||||
},
|
||||
})
|
||||
.then(() => {
|
||||
this.$store.commit('language', this.language)
|
||||
this.cancelEdit()
|
||||
})
|
||||
.catch((error) => {
|
||||
this.$toasted.error(error.message)
|
||||
})
|
||||
},
|
||||
|
||||
buildLanguage() {
|
||||
return 'languages.' + this.$store.state.language
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user