Zend_Validate_Barcode_* : bad error message keys for internationalization

2 messages Options
Embed this post
Permalink
Jeroen Keppens

Zend_Validate_Barcode_* : bad error message keys for internationalization

Reply Threaded More More options
Print post
Permalink
Hi,

I think that the error messages for the validator are not defined well
if you want to let your translate class loose on it:

Zend_Validate_Barcode_Ean13

Array
(
    [invalid] => '%value%' is an invalid EAN-13 barcode
    [invalidLength] => '%value%' should be 13 characters
    [ean13NotNumeric] => '%value%' should contain only numeric characters
)

Zend_Validate_Barcode_UpcA

Array
(
    [invalid] => '%value%' is an invalid UPC-A barcode
    [invalidLength] => '%value%' should be 12 characters
)

Both classes have validation failure message keys "invalid" and
"invalidLength".

When you put this in your translate object, you have to use the same
keys. The other validation classes have more meaningful keys. For
example: fileFilesSizeTooBig, notGreaterThan,...

Wouldn't it be better if those keys for the barcode are also more
meaningful? Like barcodeEanInvalid, barcodeUpcInvalid,...?

With kind regards,

Jeroen Keppens
Thomas Weidner

Re: Zend_Validate_Barcode_* : bad error message keys for internationalization

Reply Threaded More More options
Print post
Permalink
It will be better, and there is already an issue regarding this.

BUT:
We are not allowed to do this due to the problem this this is a BC break.

So we have eighter to wait for 2.0 or if we get an acceptance from the
dev-team (which I don't think due to BC break) we could earliest change it
with 1.8.

You can find the issue under:
http://framework.zend.com/issues/browse/ZF-3164

Greetings
Thomas Weidner, I18N Team Leader, Zend Framework
http://www.thomasweidner.com

----- Original Message -----
From: "Jeroen Keppens" <[hidden email]>
To: <[hidden email]>
Sent: Sunday, January 18, 2009 3:22 PM
Subject: [fw-i18n] Zend_Validate_Barcode_* : bad error message keys for
internationalization


> Hi,
>
> I think that the error messages for the validator are not defined well
> if you want to let your translate class loose on it:
>
> Zend_Validate_Barcode_Ean13
>
> Array
> (
>    [invalid] => '%value%' is an invalid EAN-13 barcode
>    [invalidLength] => '%value%' should be 13 characters
>    [ean13NotNumeric] => '%value%' should contain only numeric characters
> )
>
> Zend_Validate_Barcode_UpcA
>
> Array
> (
>    [invalid] => '%value%' is an invalid UPC-A barcode
>    [invalidLength] => '%value%' should be 12 characters
> )
>
> Both classes have validation failure message keys "invalid" and
> "invalidLength".
>
> When you put this in your translate object, you have to use the same
> keys. The other validation classes have more meaningful keys. For
> example: fileFilesSizeTooBig, notGreaterThan,...
>
> Wouldn't it be better if those keys for the barcode are also more
> meaningful? Like barcodeEanInvalid, barcodeUpcInvalid,...?
>
> With kind regards,
>
> Jeroen Keppens