[WIP] Add full stop at end of validator messages (fixes #2966) #2984

Closed
wants to merge 9 commits into
from

Projects

None yet

3 participants

@localheinz
Zend Framework member

I also added a few , after the last item in the initialization of the validation message templates.

@localheinz
Zend Framework member

Hold it a second, missed a few validation messages.

@localheinz
Zend Framework member

:trollface:

@weierophinney
Zend Framework member

You'll also need to update the keys in all the various Zend_Validate.php files under the resources/languages/* tree; otherwise translations for the messages will fail.

Thanks in advance, though!

@localheinz
Zend Framework member

@weierophinney Will do!

@localheinz
Zend Framework member

@weierophinney While going through the files, I've come across a number of occurrences of creditcard or mimetypein the validation messages. Shouldn't these be credit card and mime type?

@localheinz
Zend Framework member

@weierophinney Translation keys have been updated.

@Maks3w
Zend Framework member

I think that this is BC Break since some developers could have manually added the stop in his own code

@localheinz
Zend Framework member
@localheinz
Zend Framework member
@weierophinney
Zend Framework member

@localheinz For exception messages, the message should not have a full stop; the reason has to do with the fact that the message becomes part of the exception message reported by PHP (e.g., "Uncaught exception 'Exception' with message 'foo bar' in /some/file/name:19").

As for validation messages, I support the idea of them having full stops. However... I'm worried about what happens for end-users -- will this break their existing code (e.g., if they've defined custom messages already)? Can you test this or ask others to test, please? If there are no issues, I'll merge. If there are, we need to discuss on the ML.

@localheinz
Zend Framework member

@weierophinney Will ask on IRC, later.

@localheinz
Zend Framework member

As @RalfEggert pointed out on the mailing list, there are a lot of keys contained in the translation files that are not used anymore.

I personally have now problems with that full stop. But there is another
issue which makes the messages translations useless currently.

#2536

For example look at this file at the text for Alpha::NOT_ALPHA:

https://github.com/localheinz/zf2/blob/54fdd82023366f5d02600a38da4b8ec1f02e2939/library/Zend/I18n/Validator/Alpha.php#L38

The input contains non alphabetic characters.

And then look at the translation for the same text:

https://github.com/localheinz/zf2/blob/54fdd82023366f5d02600a38da4b8ec1f02e2939/resources/languages/de/Zend_Validate.php#L31

'%value%' contains non alphabetic characters.

There are a lot of these messages in the translation files which are out
of date and which are still using a phrase like '%value%' while the
message uses 'The input' already.

So your full stops does not brake anything that is not already broken.

@weierophinney
Zend Framework member

@localheinz Based on the ML thread, it sounds like making the changes is a go, with the following approach:

  • Create new files named "Zend_Validator.php", with the new translation strings within these.
  • Mark the old "Zend_Validate.php" files with a @deprecated annotation in the file-level docblock
  • Make all changes on the develop branch, as this should be messaged as part of a minor release.
@localheinz
Zend Framework member
@nidelson nidelson added a commit to nidelson/zf2 that referenced this pull request Jan 21, 2013
@nidelson nidelson Add full stop at phrases to match #2984 a1b9a3c
@weierophinney
Zend Framework member

@localheinz I cleared the 2.1.0 milestone from this, as it looks unlikely you'll get to it this week. If you do, and we merge, I'll re-add the milestone.

@localheinz
Zend Framework member
@weierophinney
Zend Framework member

@localheinz Considering the last activity was over a month ago, before 2.1 was released, I'm thinking I should close this, and have you open a new PR against master when you're ready to continue on this. We can then tag the appropriate milestone at that time.

@ghost Unknown pushed a commit that referenced this pull request Jul 14, 2013
@nidelson nidelson Add full stop at phrases to match #2984 48fd691
@gianarb gianarb pushed a commit to zendframework/zend-validator that referenced this pull request May 15, 2015
@nidelson nidelson Add full stop at phrases to match zendframework/zendframework#2984 5d66b8d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment