Skip to content

Commit

Permalink
i18n: Improve the CSRF error message
Browse files Browse the repository at this point in the history
  • Loading branch information
marien-probesys committed Jan 10, 2024
1 parent db600db commit 1595742
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tests/Controller/MessageDocumentsControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public function testPostCreateFailsIfCsrfTokenIsInvalid(): void
/** @var string */
$content = $response->getContent();
$responseData = json_decode($content, true);
$this->assertSame('The security token is invalid, please try again.', $responseData['error']);
$this->assertStringContainsString('The security token is invalid', $responseData['error']);
}

public function testPostCreateFailsIfMimetypeIsInvalid(): void
Expand Down Expand Up @@ -413,7 +413,7 @@ public function testPostDeleteFailsIfCsrfIsInvalid(): void
/** @var string */
$content = $response->getContent();
$responseData = json_decode($content, true);
$this->assertSame('The security token is invalid, please try again.', $responseData['error']);
$this->assertStringContainsString('The security token is invalid', $responseData['error']);
}

public function testGetIndexListsTheFile(): void
Expand Down
2 changes: 1 addition & 1 deletion translations/errors+intl-icu.en_GB.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ contract.max_hours.required: 'Enter a number of hours.'
contract.name.max_chars: 'Enter a name of less than {limit} characters.'
contract.name.required: 'Enter a name.'
contract.start_at.required: 'Enter a start date.'
csrf.invalid: 'The security token is invalid, please try again.'
csrf.invalid: 'The security token is invalid. Please try to resubmit the form.'
mailbox.authentication.invalid: 'Select an authentication method from the list.'
mailbox.encryption.invalid: 'Select an encryption method from the list.'
mailbox.folder.required: 'Enter a folder.'
Expand Down
2 changes: 1 addition & 1 deletion translations/errors+intl-icu.fr_FR.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ contract.max_hours.required: 'Saisissez un nombre d’heures.'
contract.name.max_chars: 'Saisissez un nom de moins de {limit} caractères.'
contract.name.required: 'Saisissez un nom.'
contract.start_at.required: 'Saisissez une date de début.'
csrf.invalid: 'Le jeton de sécurité est invalide, veuillez réessayer.'
csrf.invalid: 'Le jeton de sécurité est invalide. Veuillez essayer de revalider le formulaire.'
mailbox.authentication.invalid: 'Sélectionnez une méthode d’authentification de la liste.'
mailbox.encryption.invalid: 'Sélectionnez une méthode de chiffrement de la liste.'
mailbox.folder.required: 'Saisissez un répertoire.'
Expand Down

0 comments on commit 1595742

Please sign in to comment.