Allow change username server-side error messages to be html #2805
Conversation
app/Models/User.php
Outdated
} elseif ($remaining->h > 0) { | ||
return ["This username will be available for use in <strong>{$remaining->h}</strong> hours."]; | ||
return [trans_choice('model_validation.user.username_available_in_hours', $remaining->hours)]; |
nanaya
Mar 26, 2018
Collaborator
The property name used between here and the check doesn't match ಠ_ಠ
Or more like ->hours
doesn't exist.
The property name used between here and the check doesn't match ಠ_ಠ
Or more like ->hours
doesn't exist.
@@ -88,11 +88,28 @@ | |||
'invalid_email' => "Doesn't seem to be a valid email address.", | |||
'too_short' => 'New password is too short.', | |||
'unknown_duplicate' => 'Username or email address already used.', | |||
'username_available_in_days' => 'This username will be available for use in <strong>:count</strong> day.|This username will be available for use in <strong>:count</strong> days.', | |||
'username_available_in_hours' => 'This username will be available for use in <strong>:count</strong> hour.|This username will be available for use in <strong>:count</strong> hours.', |
nanaya
Mar 26, 2018
Collaborator
The <strong>
part can probably be extended to include its unit as well (or just removed because current design has <strong>
wrapping the whole thing). And then the hours and days version can be merged or something.
The <strong>
part can probably be extended to include its unit as well (or just removed because current design has <strong>
wrapping the whole thing). And then the hours and days version can be merged or something.
@@ -88,11 +88,28 @@ | |||
'invalid_email' => "Doesn't seem to be a valid email address.", | |||
'too_short' => 'New password is too short.', | |||
'unknown_duplicate' => 'Username or email address already used.', | |||
'username_available_in_days' => '{1} This username will be available for use in :count day.|[2,*] This username will be available for use in :count days.', | |||
'username_available_in_hours' => '{1} This username will be available for use in :count hour.|[2,*] This username will be available for use in :count hours.', |
nanaya
Mar 26, 2018
Collaborator
does it actually do anything? Looks the same as without explicit numbers.
does it actually do anything? Looks the same as without explicit numbers.
notbakaneko
Mar 26, 2018
Author
Collaborator
it makes the pl
translation use the en
rules when untranslated
it makes the pl
translation use the en
rules when untranslated
nanaya
Mar 26, 2018
Collaborator
looks more like symfony/laravel bug ಠ_ಠ also missing 0.
looks more like symfony/laravel bug ಠ_ಠ also missing 0.
notbakaneko
Mar 26, 2018
Author
Collaborator
we won't need 0 yet 
we won't need 0 yet
nanaya
Mar 26, 2018
Collaborator
I'd rather "fix" the trans_choice
function so we don't need to do this for everything.
I'd rather "fix" the trans_choice
function so we don't need to do this for everything.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
fixes #2793 and #2798
Also move the messages to translations.