Zend Framework

Unable to translate correct Barcode error message

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.5.3
  • Fix Version/s: 1.10.0
  • Component/s: Zend_Validate
  • Labels:
    None

Description

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'.

Issue Links

Activity

Hide
Andries Seutens added a comment -

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

Show
Andries Seutens added a comment - I cannot fix this issue without a BC break. I have postponed it for now, until Matthew can tell me more.
Hide
Thomas Weidner added a comment -

Depends on ZF-3614.

BC break, will probably be addressed with the next release

Show
Thomas Weidner added a comment - Depends on ZF-3614. BC break, will probably be addressed with the next release
Hide
Thomas Weidner added a comment -

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

Show
Thomas Weidner added a comment - Sorry... Wrong issue number... I meant ZF-3164
Hide
Thomas Weidner added a comment -

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.

Show
Thomas Weidner added a comment - 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.
Hide
Thomas Weidner added a comment -

Assigned to matthew after a discussion in #zftalk.

Show
Thomas Weidner added a comment - Assigned to matthew after a discussion in #zftalk.
Hide
Thomas Weidner added a comment -

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.

Show
Thomas Weidner added a comment - 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.
Hide
Thomas Weidner added a comment -

Probably fixed with r17874 for ZF 1.10

Show
Thomas Weidner added a comment - Probably fixed with r17874 for ZF 1.10

People

Vote (2)
Watch (3)

Dates

  • Created:
    Updated:
    Resolved: