aboutsummaryrefslogtreecommitdiff
path: root/src/components/registration/registration.js
diff options
context:
space:
mode:
authorHJ <30-hj@users.noreply.git.pleroma.social>2022-05-22 16:35:51 +0000
committerHJ <30-hj@users.noreply.git.pleroma.social>2022-05-22 16:35:51 +0000
commita88abc7ee3b78427e40bc4d2346a78e9871d1ba4 (patch)
treec44cc8357b9c04c6d87337ee81badfd10bc0f004 /src/components/registration/registration.js
parent396349fdf2aeae253f9f2f77e43f1875fa4a67de (diff)
parentf57171d7b97d344d1a30df4cf6e5a5b29a8e2b5d (diff)
Merge branch 'from/develop/tusooa/lang-opts' into 'develop'
Add language options See merge request pleroma/pleroma-fe!1494
Diffstat (limited to 'src/components/registration/registration.js')
-rw-r--r--src/components/registration/registration.js14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/components/registration/registration.js b/src/components/registration/registration.js
index a3ef0f04..6eb316d0 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()