From 5e110fd0426085f4bdda5c9c6e2c9be4a20f2aaf Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Tue, 8 Oct 2019 18:28:35 +0200 Subject: [PATCH] Make sure the registration email is sent with the correct locale Closes #189 Signed-off-by: Thomas Citharel --- js/src/graphql/user.ts | 4 ++-- js/src/i18n/en_US.json | 2 +- js/src/i18n/fr_FR.json | 2 +- js/src/i18n/oc.json | 2 +- js/src/views/User/Register.vue | 2 ++ js/src/views/User/ResendConfirmation.vue | 2 +- js/src/views/User/SendPasswordReset.vue | 2 +- 7 files changed, 9 insertions(+), 7 deletions(-) diff --git a/js/src/graphql/user.ts b/js/src/graphql/user.ts index ae7ee2629..6a3e82081 100644 --- a/js/src/graphql/user.ts +++ b/js/src/graphql/user.ts @@ -1,8 +1,8 @@ import gql from 'graphql-tag'; export const CREATE_USER = gql` -mutation CreateUser($email: String!, $password: String!) { - createUser(email: $email, password: $password) { +mutation CreateUser($email: String!, $password: String!, $locale: String) { + createUser(email: $email, password: $password, locale: $locale) { email, confirmationSentAt } diff --git a/js/src/i18n/en_US.json b/js/src/i18n/en_US.json index 6357caac5..14c63e478 100644 --- a/js/src/i18n/en_US.json +++ b/js/src/i18n/en_US.json @@ -173,7 +173,7 @@ "Past events": "Passed events", "Pick an identity": "Pick an identity", "Please be nice to each other": "Please be nice to each other", - "Please check you spam folder if you didn't receive the email.": "Please check you spam folder if you didn't receive the email.", + "Please check your spam folder if you didn't receive the email.": "Please check your spam folder if you didn't receive the email.", "Please contact this instance's Mobilizon admin if you think this is a mistake.": "Please contact this instance's Mobilizon admin if you think this is a mistake.", "Please make sure the address is correct and that the page hasn't been moved.": "Please make sure the address is correct and that the page hasn't been moved.", "Please read the full rules": "Please read the full rules", diff --git a/js/src/i18n/fr_FR.json b/js/src/i18n/fr_FR.json index 1b87577d2..e8d9e5987 100644 --- a/js/src/i18n/fr_FR.json +++ b/js/src/i18n/fr_FR.json @@ -159,7 +159,7 @@ "Past events": "Événements passés", "Pick an identity": "Choisissez une identité", "Please be nice to each other": "Soyez sympas entre vous", - "Please check you spam folder if you didn't receive the email.": "Merci de vérifier votre dossier des indésirables si vous n'avez pas reçu l'email.", + "Please check your spam folder if you didn't receive the email.": "Merci de vérifier votre dossier des indésirables si vous n'avez pas reçu l'email.", "Please contact this instance's Mobilizon admin if you think this is a mistake.": "Veuillez contacter l'administrateur de cette instance Mobilizon si vous pensez qu’il s’agit d’une erreur.", "Please make sure the address is correct and that the page hasn't been moved.": "Assurez‐vous que l’adresse est correcte et que la page n’a pas été déplacée.", "Please read the full rules": "Merci de lire les règles complètes", diff --git a/js/src/i18n/oc.json b/js/src/i18n/oc.json index 82f28745f..d80296929 100644 --- a/js/src/i18n/oc.json +++ b/js/src/i18n/oc.json @@ -224,7 +224,7 @@ "The event organizer has chosen to approve manually the participations to this event. You will receive a notification when your participation has been approved": "L’organizator de l’eveniment causèt d’aprovar manualament las participacions d’aqueste eveniment. Recebretz una notificacion quand serà aprovada", "The event came from another instance. Your participation will be confirmed after we confirm it with the other instance.": "L’eveniment ven d’una autra instància. Vòstra participacion serà confirmada aprèp qu’ajam recebut la confirmacion de l’autra instància.", "Please contact this instance's Mobilizon admin if you think this is a mistake.": "Volgatz contactar l’administrator d’aquesta instància Mobilizon se pensatz qu’es una error.", - "Please check you spam folder if you didn't receive the email.": "Mercés de verificar vòstre dorsièr de messatges indesirables s’avètz pas recebut lo corrièl.", + "Please check your spam folder if you didn't receive the email.": "Mercés de verificar vòstre dorsièr de messatges indesirables s’avètz pas recebut lo corrièl.", "If this identity is the only administrator of some groups, you need to delete them before being able to delete this identity.": "S’aquesta identitat es l’unica que pòt administrar unes grops, vos cal los suprimir d’en primièr per dire de poder suprimir aquesta identitat.", "The content came from another server. Transfer an anonymous copy of the report?": "Lo contengut ven d’una autra instància. Transferir una còpia anonima del senhalament ?", "Please make sure the address is correct and that the page hasn't been moved.": "Asseguratz-vos que l’adreça es corrècta e que la pagina es pas estada desplaçada.", diff --git a/js/src/views/User/Register.vue b/js/src/views/User/Register.vue index 3cbf2945a..589da6977 100644 --- a/js/src/views/User/Register.vue +++ b/js/src/views/User/Register.vue @@ -115,6 +115,7 @@ export default class Register extends Vue { credentials = { email: this.email, password: this.password, + locale: 'en', }; errors: object = {}; sendingValidation: boolean = false; @@ -122,6 +123,7 @@ export default class Register extends Vue { RouteName = RouteName; async submit() { + this.credentials.locale = this.$i18n.locale; try { this.sendingValidation = true; this.errors = {}; diff --git a/js/src/views/User/ResendConfirmation.vue b/js/src/views/User/ResendConfirmation.vue index 283866c16..afb34c854 100644 --- a/js/src/views/User/ResendConfirmation.vue +++ b/js/src/views/User/ResendConfirmation.vue @@ -17,7 +17,7 @@ {{ $t('If an account with this email exists, we just sent another confirmation email to {email}', {email: credentials.email}) }} - {{ $t("Please check you spam folder if you didn't receive the email.") }} + {{ $t("Please check your spam folder if you didn't receive the email.") }} diff --git a/js/src/views/User/SendPasswordReset.vue b/js/src/views/User/SendPasswordReset.vue index 5583d8165..5ad1150ed 100644 --- a/js/src/views/User/SendPasswordReset.vue +++ b/js/src/views/User/SendPasswordReset.vue @@ -18,7 +18,7 @@ {{ $t('We just sent an email to {email}', {email: credentials.email}) }} - {{ $t("Please check you spam folder if you didn't receive the email.") }} + {{ $t("Please check your spam folder if you didn't receive the email.") }}