yiisoft / validator

Yii validator library
https://www.yiiframework.com/
BSD 3-Clause "New" or "Revised" License
112 stars 39 forks source link

Add method `Result::addErrorWithoutTranslation()` #665

Closed vjik closed 7 months ago

vjik commented 7 months ago
Q A
Is bugfix?
New feature? ✔️
Breaks BC?
Fixed issues
codecov[bot] commented 7 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

:exclamation: No coverage uploaded for pull request base (1.x@c61ada5). Click here to learn what that means.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## 1.x #665 +/- ## ====================================== Coverage ? 94.59% Complexity ? 776 ====================================== Files ? 91 Lines ? 2387 Branches ? 0 ====================================== Hits ? 2258 Misses ? 129 Partials ? 0 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

samdark commented 7 months ago

What's the use-case for not translating errors?

vjik commented 7 months ago

What's the use-case for not translating errors?

1) In single language apps for custom error messages. Such messages not need to translate.

2) This PR prevent duplicate translations (after Each and Nested rules), because validator always returns translated messages.

BoShurik commented 7 months ago

Does it mean that yiisoft/translator can be optional?

vjik commented 7 months ago

Does it mean that yiisoft/translator can be optional?

Potentially, we can refine the package like this.