Merge pull request #880 from gradido/733-language-switch-toast-success

733 language switch toast success
This commit is contained in:
Hannes Heine 2021-09-22 12:39:23 +02:00 committed by GitHub
commit 5e0b052206
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 3 deletions

View File

@ -105,7 +105,8 @@
"language": "Sprache",
"languages": {
"de": "Deutsch",
"en": "English"
"en": "English",
"success": "Deine Sprache wurde erfolgreich geändert."
},
"login": "Anmeldung",
"logout": "Abmelden",

View File

@ -105,7 +105,8 @@
"language": "Language",
"languages": {
"de": "Deutsch",
"en": "English"
"en": "English",
"success": "Your language has been successfully updated."
},
"login": "Login",
"logout": "Logout",

View File

@ -62,6 +62,7 @@
</b-card>
</template>
<script>
import { localeChanged } from 'vee-validate'
import LanguageSwitchSelect from '../../../components/LanguageSwitchSelect.vue'
import { updateUserInfos } from '../../../graphql/queries'
@ -98,8 +99,11 @@ export default {
},
})
.then(() => {
this.$store.commit('language', this.language)
this.$i18n.locale = this.language
this.$store.commit('language', this.$i18n.locale)
localeChanged(this.$i18n.locale)
this.cancelEdit()
this.$toasted.success(this.$t('languages.success'))
})
.catch((error) => {
this.$toasted.error(error.message)