Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

[Minor BC] Remove translation of validator keys #5664

Merged
merged 1 commit into from
Jan 16, 2014
Merged

[Minor BC] Remove translation of validator keys #5664

merged 1 commit into from
Jan 16, 2014

Conversation

macnibblet
Copy link
Contributor

Removes the translation of validator message _keys_ which is totally
absurd in the first place. They are constants that should not be
modified.

Removes the translation of validator message ***keys*** which is totally
absurd in the first place. They are constants that should not be
modified.
@@ -96,7 +96,7 @@ public function testMaximumErrorMessageLength()

$loader = new TestAsset\ArrayTranslator();
$loader->translations = array(
Alpha::INVALID => 'This is the translated message for %value%',
'Invalid type given. String expected' => 'This is the translated message for %value%',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this? If the constant does not aim to be readable then we can still relying in the value whatever it is.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because we are not translating the validator message _keys_ but the validator messages

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In theory it would be nice to do $validator->templateMessages[Alpha::INVALID] => '...' but templateMessages is protected so it's not possiblo

weierophinney added a commit that referenced this pull request Jan 16, 2014
…age-key-translation

[Minor BC] Remove translation of validator keys
weierophinney added a commit that referenced this pull request Jan 16, 2014
- Like #5666, this is technically a BC break and needs a note in the changelog.
weierophinney added a commit that referenced this pull request Jan 16, 2014
@weierophinney weierophinney merged commit 341fc4c into zendframework:develop Jan 16, 2014
@ghost ghost assigned weierophinney Jan 16, 2014
weierophinney added a commit to zendframework/zend-validator that referenced this pull request May 15, 2015
…otfix/remove-validator-message-key-translation

[Minor BC] Remove translation of validator keys
weierophinney added a commit to zendframework/zend-validator that referenced this pull request May 15, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants