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

Conversation

localheinz
Copy link
Member

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

@localheinz
Copy link
Member Author

Hold it a second, missed a few validation messages.

@localheinz
Copy link
Member Author

:trollface:

@weierophinney
Copy link
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
Copy link
Member Author

@weierophinney Will do!

@localheinz
Copy link
Member Author

@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
Copy link
Member Author

@weierophinney Translation keys have been updated.

@Maks3w
Copy link
Member

Maks3w commented Dec 2, 2012

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

@localheinz
Copy link
Member Author

I don't mind leaving this for 3.0, but I think there are a few more issues where missing full stops in exception messages are mentioned as well.

Plus, the longer the full stops aren't there, the more developers might have put them there in their forms, which means there could be even more pressure against fixing this within the framework's code.

I think this should be standardized throughout the framework.

@weierophinney What are your experiences regarding exception and validation message standards?

@localheinz
Copy link
Member Author

Trying to find supporting documents.

What's this?

@weierophinney
Copy link
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
Copy link
Member Author

@weierophinney Will ask on IRC, later.

@localheinz
Copy link
Member Author

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
Copy link
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
Copy link
Member Author

@weierophinney I will do, but won't make it this or next week.

Thanks!

@weierophinney
Copy link
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
Copy link
Member Author

👍

Too busy at the moment. Will do, though.

@weierophinney
Copy link
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.

gianarb pushed 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