ZF-3920: Unable to translate correct Barcode error message

Issue Type: Bug Created: 2008-08-11T02:50:38.000+0000 Last Updated: 2009-08-29T01:45:39.000+0000 Status: Resolved Fix version(s): - 1.10.0 (27/Jan/10)

Reporter: Václav Vaník (dimmu) Assignee: Thomas Weidner (thomas) Tags: - Zend_Validate

Related issues: - ZF-3164



I found a bug in Zend_Validate_Barcode_UpcA and Zend_Validate_Barcode_Ean13.

These validators have same constant value for error messages:

class Zend_Validate_Barcode_UpcA .. protected $_messageTemplates = array( self::INVALID => "'%value%' is an invalid UPC-A barcode", self::INVALID_LENGTH => "'%value%' should be 12 characters", ); ..

class Zend_Validate_Barcode_Ean13 ... protected $_messageTemplates = array( self::INVALID => "'%value%' is an invalid EAN-13 barcode", self::INVALID_LENGTH => "'%value%' should be 13 characters", ); ...

So I am unable to translate right error message with e.g. Tmx adapter because translation ids are identical.

A simple solution would be to rename the 'invalid' to 'invalidupca' and 'invalidean13'.


Posted by Andries Seutens (andries) on 2008-10-09T11:25:09.000+0000

I cannot fix this issue without a BC break. I have postponed it for now, until Matthew can tell me more.

Posted by Thomas Weidner (thomas) on 2008-12-09T02:26:54.000+0000

Depends on ZF-3614.

BC break, will probably be addressed with the next release

Posted by Thomas Weidner (thomas) on 2008-12-09T02:28:19.000+0000

Sorry... Wrong issue number... I meant ZF-3164

Posted by Thomas Weidner (thomas) on 2008-12-15T12:14:34.000+0000

I propose to make a sort of standard for keys. A working solution would be to name the keys like: - classError

For example: barcodeUpcInvalid barCodeEanInvalid stringLengthInvalid

and so on. I think you get an idea.

Posted by Thomas Weidner (thomas) on 2008-12-15T12:16:03.000+0000

Assigned to matthew after a discussion in #zftalk.

Posted by Thomas Weidner (thomas) on 2009-03-11T13:46:20.000+0000

Issue has been postponed until 2.0 after a discussion with the dev-team. Reason is that the fix for this issue would be a BC break.

Posted by Thomas Weidner (thomas) on 2009-08-29T01:45:39.000+0000

Probably fixed with r17874 for ZF 1.10

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.