-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(mon-pix): better use of translations
- Loading branch information
1 parent
5dbdef5
commit f76df29
Showing
6 changed files
with
50 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,9 @@ export default class PasswordResetDemandForm extends Component { | |
|
||
@tracked isLoading = false; | ||
@tracked errorMessage; | ||
@tracked emailInputPlaceholder = this.intl.t( | ||
'components.authentication.password-reset-demand-form.fields.email.placeholder', | ||
); | ||
@tracked emailInputvalidationStatus; | ||
@tracked emailInputvalidationErrorMessage; | ||
|
||
|
@@ -27,7 +30,7 @@ export default class PasswordResetDemandForm extends Component { | |
this.email = event.target.value; | ||
this.emailInputvalidationStatus = isEmailValid(this.email) ? 'success' : 'error'; | ||
this.emailInputvalidationErrorMessage = this.intl.t( | ||
'components.authentication.password-reset-demand-form.invalid-email', | ||
'components.authentication.password-reset-demand-form.fields.email.error-message-invalid', | ||
); | ||
} | ||
|
||
|
@@ -53,7 +56,7 @@ export default class PasswordResetDemandForm extends Component { | |
body: JSON.stringify({ email }), | ||
}); | ||
if (response.status == 404) { | ||
this.errorMessage = this.intl.t('pages.password-reset-demand.error.message'); | ||
this.errorMessage = this.intl.t('components.authentication.password-reset-demand-form.404-message'); | ||
} else if (!response.ok) { | ||
throw new Error(`Response status: ${response.status}`); | ||
} | ||
|
@@ -87,10 +90,10 @@ export default class PasswordResetDemandForm extends Component { | |
{{on "change" this.handleEmailChange}} | ||
@validationStatus={{this.emailInputvalidationStatus}} | ||
@errorMessage={{this.emailInputvalidationErrorMessage}} | ||
placeholder="[email protected]" | ||
placeholder={{this.emailInputPlaceholder}} | ||
required={{true}} | ||
> | ||
<:label>{{t "pages.password-reset-demand.fields.email.label"}}</:label> | ||
<:label>{{t "components.authentication.password-reset-demand-form.fields.email.label"}}</:label> | ||
</PixInput> | ||
</div> | ||
<div> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -152,14 +152,21 @@ | |
"signup-heading": "Other ways to sign up" | ||
}, | ||
"password-reset-demand-form": { | ||
"404-message": "The email address entered does not match any Pix account", | ||
"actions": { | ||
"receive-reset-button": "Receive a reset link" | ||
}, | ||
"contact-us-link": { | ||
"link-text": "Contact us", | ||
"link-url": "https://pix.org/en/support" | ||
}, | ||
"invalid-email": "Your email address is invalid.", | ||
"fields": { | ||
"email": { | ||
"error-message-invalid": "Your email address is invalid.", | ||
"label": "Email address", | ||
"placeholder": "ex: [email protected]" | ||
} | ||
}, | ||
"no-email-question": "No email address?", | ||
"rule": "All fields are required." | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -172,13 +172,20 @@ | |
} | ||
}, | ||
"password-reset-demand-form": { | ||
"invalid-email": "Your email address is invalid.", | ||
"404-message": "Esta dirección de correo electrónico no corresponde a ninguna cuenta", | ||
"rule": "All fields are required.", | ||
"no-email-question": "No email address?", | ||
"contact-us-link": { | ||
"link-text": "Contact us", | ||
"link-url": "https://pix.org/en/support" | ||
}, | ||
"fields": { | ||
"email": { | ||
"invalid-email": "Your email address is invalid.", | ||
"label": "Email address", | ||
"placeholder": "ex: [email protected]" | ||
} | ||
}, | ||
"actions": { | ||
"receive-reset-button": "Receive a reset link" | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -152,14 +152,21 @@ | |
"signup-heading": "Autres moyens d’inscription" | ||
}, | ||
"password-reset-demand-form": { | ||
"404-message": "Cette adresse e-mail ne correspond à aucun compte", | ||
"actions": { | ||
"receive-reset-button": "Recevoir un lien de réinitialisation" | ||
}, | ||
"contact-us-link": { | ||
"link-text": "Contactez-nous", | ||
"link-url": "https://pix.fr/support" | ||
}, | ||
"invalid-email": "Votre adresse e-mail n’est pas valide.", | ||
"fields": { | ||
"email": { | ||
"error-message-invalid": "Votre adresse e-mail n’est pas valide.", | ||
"label": "Adresse e-mail", | ||
"placeholder": "ex: [email protected]" | ||
} | ||
}, | ||
"no-email-question": "Pas d’adresse e-mail renseignée ?", | ||
"rule": "Tous les champs sont obligatoires." | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -172,13 +172,20 @@ | |
} | ||
}, | ||
"password-reset-demand-form": { | ||
"invalid-email": "Your email address is invalid.", | ||
"404-message": "Dit e-mailadres komt niet overeen met een account", | ||
"rule": "All fields are required.", | ||
"no-email-question": "No email address?", | ||
"contact-us-link": { | ||
"link-text": "Contact us", | ||
"link-url": "https://pix.org/nl-be/support" | ||
}, | ||
"fields": { | ||
"email": { | ||
"error-message-invalid": "Your email address is invalid.", | ||
"label": "Email address", | ||
"placeholder": "ex: [email protected]" | ||
} | ||
}, | ||
"actions": { | ||
"receive-reset-button": "Receive a reset link" | ||
} | ||
|