Re: Standardized way of interpolating variables into PEAR_Exception messages?
| From: | Alexey Borzov | Date: | Sat, 23 Sep 2006 21:46:13 +0000 |
| Subject: | Re: Standardized way of interpolating variables into PEAR_Exception messages? | ||
| References: | 1 2 3 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-44019@lists.php.net to get a copy of this message | ||
Hi,
Pierre wrote:
The problem with this approach is that it becomes very difficult to internationalize the message strings -- which is why, in my definition for File_MARC_Exception near the bottom of http://marc.coffeecode.net/highlight_MARC.php, I've defined the error codes as class constants and a static array of messages with the error codes as the keys to the array.I rather meant standard sprintf() vs. homebrewn interpolateMessageVariables() or whatever. But as you said, we don't do error messages i18n usually.What's wrong with more-or-less standard throw new Foo_Exception(sprintf(_('The value of VAR cannot be '%s'), $var)); why reimplement it? And why it is reimplemented in ErrorStack in the first place?_() has nothing standard. We never provide localized messages either. I also don't think we should provide them. Errors messages at this level (a library) are for developers, not end users.
Ah... and I've just been told on IRC that the RFC requiring PEAR_Exception for PHP5 packages, although "approved", is not necessarily a requirement after all. It might be nice to edit "approved...but despite that, not agreed upon or required" proposals to reflect their true status. I'm just trying to strictly follow all of the coding standards for my proposals as best I can.Hey, you are Mr. PEAR Group, not me. If you want to make up new rules for accepting proposals then go ahead and make them up, but please follow due procedure [1] for this. The exceptions proposal was accepted 2 years ago, but people who supposedly have issues with it didn't try to do anything to fix these issues. Speaking of issues... Can you give an estimate on when package download statistics will be available again on PEAR website? [1] http://pear.php.net/group/docs/20040322-vm.phpThat's complete and utter BS.Alexey, again, keep such words out of this list.The proposal is either accepted or not, whether the anonymous person on IRC likes it or not.And I confirm that this pepr is not accepted. We are not going to accept such changes with five +1, we never did and we will not start now. A large participation and agreement is required.