Skip to content

Commit ff15850

Browse files
committed
localize validation message
1 parent 3fddc93 commit ff15850

3 files changed

Lines changed: 3 additions & 2 deletions

File tree

lang/en/validation.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@
169169
'date_fieldtype_time_required' => 'Time is required.',
170170
'duplicate_field_handle' => 'A field with a handle of :handle already exists.',
171171
'duplicate_uri' => 'Duplicate URI :value',
172+
'elevated_session_resend_code_unavailable' => 'Resend code is only available for verification code method.',
172173
'elevated_session_verification_code' => 'The verification code is incorrect.',
173174
'email_available' => 'A user with this email already exists.',
174175
'fieldset_imported_recursively' => 'Fieldset :handle is being imported recursively.',

src/Http/Controllers/Auth/ElevatedSessionController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public function resendCode()
8484
{
8585
if (User::current()->getElevatedSessionMethod() !== 'verification_code') {
8686
throw ValidationException::withMessages([
87-
'method' => 'Resend code is only available for verification code method',
87+
'method' => __('statamic::validation.elevated_session_resend_code_unavailable'),
8888
]);
8989
}
9090

tests/Auth/ElevatedSessionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ public function the_verification_code_will_not_be_sent_if_the_user_has_a_passwor
422422
->actingAs($this->user)
423423
->from('/original')
424424
->get(cp_route('elevated-session.resend-code'))
425-
->assertSessionHasErrors(['method' => 'Resend code is only available for verification code method'])
425+
->assertSessionHasErrors(['method' => 'Resend code is only available for verification code method.'])
426426
->assertSessionMissing('statamic_elevated_session_verification_code');
427427

428428
Notification::assertNothingSent();

0 commit comments

Comments
 (0)