diff --git a/src/components/interface_language_switcher/interface_language_switcher.vue b/src/components/interface_language_switcher/interface_language_switcher.vue index 078535dc..7ad1fe2e 100644 --- a/src/components/interface_language_switcher/interface_language_switcher.vue +++ b/src/components/interface_language_switcher/interface_language_switcher.vue @@ -37,7 +37,7 @@ export default { required: true }, setLanguage: { - type: String, + type: Function, required: true } }, diff --git a/src/components/registration/registration.js b/src/components/registration/registration.js index a3ef0f04..e3f6b875 100644 --- a/src/components/registration/registration.js +++ b/src/components/registration/registration.js @@ -1,6 +1,8 @@ import useVuelidate from '@vuelidate/core' import { required, requiredIf, sameAs } from '@vuelidate/validators' import { mapActions, mapState } from 'vuex' +import InterfaceLanguageSwitcher from '../interface_language_switcher/interface_language_switcher.vue' +import localeService from '../../services/locale/locale.service.js' const registration = { setup () { return { v$: useVuelidate() } }, @@ -11,10 +13,14 @@ const registration = { username: '', password: '', confirm: '', - reason: '' + reason: '', + language: '', }, captcha: {} }), + components: { + InterfaceLanguageSwitcher + }, validations () { return { user: { @@ -26,7 +32,8 @@ const registration = { required, sameAs: sameAs(this.user.password) }, - reason: { required: requiredIf(() => this.accountApprovalRequired) } + reason: { required: requiredIf(() => this.accountApprovalRequired) }, + language: {} } } }, @@ -64,6 +71,9 @@ const registration = { this.user.captcha_solution = this.captcha.solution this.user.captcha_token = this.captcha.token this.user.captcha_answer_data = this.captcha.answer_data + if (this.user.language) { + this.user.language = localeService.internalToBackendLocale(this.user.language) + } this.v$.$touch() diff --git a/src/components/registration/registration.vue b/src/components/registration/registration.vue index 3d409109..6fa70a09 100644 --- a/src/components/registration/registration.vue +++ b/src/components/registration/registration.vue @@ -162,6 +162,18 @@ +