Zend Framework

Zend_Captcha validation messages are not static which makes them harder to translate

Details

  • Type: Improvement Improvement
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Incomplete
  • Affects Version/s: 1.8.4
  • Fix Version/s: None
  • Component/s: Zend_Captcha
  • Labels:
    None

Description

I use one translate adapter for all my forms, but cannot seem to translate the captcha error messages.

For example, it's really easy to be able to define

Zend_Validate_NotEmpty::IS_EMPTY => 'Some localized errormessage'

but this seems impossible with the current CAPTCHA adapter.

Activity

Hide
Stanislav Malyshev added a comment -

I'm not sure I understand the problem... Captcha adapters do have message templates, e.g. recaptcha:

protected $_messageTemplates = array(
self::MISSING_VALUE => 'Missing captcha fields',
self::ERR_CAPTCHA => 'Failed to validate captcha',
self::BAD_CAPTCHA => 'Captcha value is wrong: %value%',
);

vs. NotEmpty

protected $_messageTemplates = array(
self::IS_EMPTY => "Value is required and can't be empty",
self::INVALID => "Invalid type given, value should be float, string, array, boolean or integer",
);

So what exactly is missing for you there?

Show
Stanislav Malyshev added a comment - I'm not sure I understand the problem... Captcha adapters do have message templates, e.g. recaptcha: protected $_messageTemplates = array( self::MISSING_VALUE => 'Missing captcha fields', self::ERR_CAPTCHA => 'Failed to validate captcha', self::BAD_CAPTCHA => 'Captcha value is wrong: %value%', ); vs. NotEmpty protected $_messageTemplates = array( self::IS_EMPTY => "Value is required and can't be empty", self::INVALID => "Invalid type given, value should be float, string, array, boolean or integer", ); So what exactly is missing for you there?
Hide
Stanislav Malyshev added a comment -

The problem not clear, please reopen with clarification if needed.

Show
Stanislav Malyshev added a comment - The problem not clear, please reopen with clarification if needed.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: