validator
validator copied to clipboard
Separate similar error messages' translations for different rules
Extracted from https://github.com/yiisoft/validator/pull/514#discussion_r1090048741.
Related: #525.
Problem: changing translation for incorrect type message might affect multiple rules. Possible solution: use keys for translation instead, something like "json.incorrectInputMessage".
This can be helpful when a user wants to hide technical details with broader messages for example.
Is there an example of a translation with a similar problem?
Usage keys added new dependency yiisoft/translator-message-php.