[Minor BC] Remove translation of validator keys #5664

Merged
merged 1 commit into from Jan 16, 2014

Conversation

Projects
None yet
3 participants
Contributor

macnibblet commented Jan 2, 2014

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

@macnibblet macnibblet [Minor BC] Remove translation of validator keys
Removes the translation of validator message ***keys*** which is totally
absurd in the first place. They are constants that should not be
modified.
341fc4c

@Maks3w Maks3w commented on the diff Jan 2, 2014

tests/ZendTest/Validator/StaticValidatorTest.php
@@ -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%',
@Maks3w

Maks3w Jan 2, 2014

Member

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

@macnibblet

macnibblet Jan 2, 2014

Contributor

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

@macnibblet

macnibblet Jan 2, 2014

Contributor

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

@weierophinney weierophinney added a commit that referenced this pull request Jan 16, 2014

@weierophinney weierophinney Merge pull request #5664 from macnibblet/hotfix/remove-validator-mess…
…age-key-translation

[Minor BC] Remove translation of validator keys
cbfa9f4

@weierophinney weierophinney added a commit that referenced this pull request Jan 16, 2014

@weierophinney weierophinney [#5664] Added note to README
- Like #5666, this is technically a BC break and needs a note in the changelog.
d8b9de6

@weierophinney weierophinney added a commit that referenced this pull request Jan 16, 2014

@weierophinney weierophinney Merge branch 'hotfix/5664' into develop
Close #5664
e0e937d

@weierophinney weierophinney merged commit 341fc4c into zendframework:develop Jan 16, 2014

1 check failed

default The Travis CI build failed
Details

@weierophinney weierophinney added a commit to zendframework/zend-validator that referenced this pull request May 15, 2015

@weierophinney weierophinney Merge pull request zendframework/zendframework#5664 from macnibblet/h…
…otfix/remove-validator-message-key-translation

[Minor BC] Remove translation of validator keys
01f8a27

@weierophinney weierophinney added a commit to zendframework/zend-validator that referenced this pull request May 15, 2015

@weierophinney weierophinney Merge branch 'hotfix/5664' into develop c418e80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment