-
Notifications
You must be signed in to change notification settings - Fork 11.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[11.x] Fixing a missing translation error #50534
Comments
Related to #46378 |
Responding to @GrahamCampbell comments: okay, the exception doesn't need to know anything about the translation. I agree with that, but how do you translate the phrase Now it looks like either we end up with a crookedly translated message, or we need to add array processing to add different variants of messages with a concatenated string with a specific number inside (but this is nonsense), or catch the validator error in the kernel and rebuild it ourselves. That is, do the same thing that the box does, but with a translation call. On the one hand, the simplest way is to put the phrase And what to do in this situation? My idea is that if the validator package allows installation of a translation package (here's the proof), then it knows about it and it can be done that way. After all, if the framework has a mechanism for translation, why does it selectively allow it? What other options are there? |
We're reverting the original PR. Thanks @andrey-helldar |
I feel really strongly this message should not be translated. Exception messages aren't meant to be shown to users? Should every exception in the framework by translated? |
Several of our applications use the content of the "message" key to display a pop-up notification, and the decryption of each field is used to draw messages under a specific field. |
@andrey-helldar our stand now is the same as it has been in the past: these messages should never reach end users. |
I got it. It's a shame. I've recently managed to convince frontenders that these reports can be trusted, but now I see that they can't. Okay. |
Laravel Version
11.0.5
PHP Version
8.3.3
Database Driver & Version
PostgreSQL 14
Description
After upgrading from Laravel 10 to Laravel 11, validation error translation started working incorrectly.
Laravel 10 could translate the phrases
(and :count more error)
and(and :count more errors)
, but Laravel 11 cannot. Because of this, English text appears in the response, which looks like an error.Laravel 10:
Laravel 11:
I have not been able to add a test case to my PR because despite requiring a dependency to be installed for translation, I get an error:
Also the phrase
The given data was invalid.
is no longer translated.The source of the problem is in this location:
framework/src/Illuminate/Validation/ValidationException.php
Lines 86 to 103 in 6e1e785
Steps To Reproduce
routes/console.php
file:php artisan foo
The text was updated successfully, but these errors were encountered: