From 1d36ea5ec58c8df870a0c6c1ec267b78b8db28f0 Mon Sep 17 00:00:00 2001 From: Tusooa Zhu Date: Sat, 26 Mar 2022 13:03:23 -0400 Subject: Add email language option to registration form --- src/components/registration/registration.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/components/registration/registration.js') 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() -- cgit v1.2.3-70-g09d2 From 3633ea66d4c6f362510788f3ae7ae4cad020629a Mon Sep 17 00:00:00 2001 From: Tusooa Zhu Date: Sat, 26 Mar 2022 13:08:22 -0400 Subject: Make lint happy --- src/components/registration/registration.js | 2 +- src/components/settings_modal/tabs/profile_tab.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/components/registration/registration.js') diff --git a/src/components/registration/registration.js b/src/components/registration/registration.js index e3f6b875..6eb316d0 100644 --- a/src/components/registration/registration.js +++ b/src/components/registration/registration.js @@ -14,7 +14,7 @@ const registration = { password: '', confirm: '', reason: '', - language: '', + language: '' }, captcha: {} }), diff --git a/src/components/settings_modal/tabs/profile_tab.js b/src/components/settings_modal/tabs/profile_tab.js index 953f17f0..9a8628f0 100644 --- a/src/components/settings_modal/tabs/profile_tab.js +++ b/src/components/settings_modal/tabs/profile_tab.js @@ -43,7 +43,7 @@ const ProfileTab = { bannerPreview: null, background: null, backgroundPreview: null, - emailLanguage: this.$store.state.users.currentUser.language + emailLanguage: this.$store.state.users.currentUser.language || '' } }, components: { @@ -123,7 +123,7 @@ const ProfileTab = { display_name: this.newName, fields_attributes: this.newFields.filter(el => el != null), bot: this.bot, - show_role: this.showRole, + show_role: this.showRole /* eslint-enable camelcase */ } -- cgit v1.2.3-70-g09d2 From 069cf3fa87c0d29803275fe66864d5e439cad309 Mon Sep 17 00:00:00 2001 From: HJ <30-hj@users.noreply.git.pleroma.social> Date: Sun, 22 May 2022 16:38:09 +0000 Subject: Revert "Merge branch 'from/develop/tusooa/lang-opts' into 'develop'" This reverts merge request !1494 --- package.json | 1 - .../interface_language_switcher.vue | 38 ++++++++++------------ src/components/registration/registration.js | 14 ++------ src/components/registration/registration.vue | 12 ------- src/components/settings_modal/tabs/general_tab.js | 6 ---- src/components/settings_modal/tabs/general_tab.vue | 6 +--- src/components/settings_modal/tabs/profile_tab.js | 38 ++++++++-------------- src/components/settings_modal/tabs/profile_tab.vue | 7 ---- src/i18n/en.json | 4 +-- src/modules/config.js | 5 --- src/services/api/api.service.js | 1 - src/services/locale/locale.service.js | 27 ++------------- yarn.lock | 5 --- 13 files changed, 37 insertions(+), 127 deletions(-) (limited to 'src/components/registration/registration.js') diff --git a/package.json b/package.json index 58aeb363..b5ece450 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,6 @@ "cropperjs": "1.5.12", "diff": "3.5.0", "escape-html": "1.0.3", - "js-cookie": "^3.0.1", "localforage": "1.10.0", "parse-link-header": "1.0.1", "phoenix": "1.6.2", diff --git a/src/components/interface_language_switcher/interface_language_switcher.vue b/src/components/interface_language_switcher/interface_language_switcher.vue index 7ad1fe2e..6d1f83c4 100644 --- a/src/components/interface_language_switcher/interface_language_switcher.vue +++ b/src/components/interface_language_switcher/interface_language_switcher.vue @@ -1,12 +1,12 @@