ZF-8134: Zend_Validate message can not translate when using Zend_Translate_Adapter_Ini

Description

Hi. To translate Zend_Validate error messages, docs described to use Zend_Validate actual error messages as message identifiers.

http://framework.zend.com/manual/en/… {quote} Alternately, as of 1.6.0, you may provide translation strings using the actual error messages as message identifiers. This is the preferred use case for 1.6.0 and up, as we will be deprecating translation of message keys in future releases. {quote}

Using ini file as messages file, and set error messages as message identifiers.


'%value%' is an empty string = "TRANSLATION MESSAGE"

Zend_Translate returns parse error, becouse some of error messages contains '()'.


$locale = new Zend_Locale('ja');
$path = dirname(__FILE__) . '/ja.ini';
$translate = new Zend_Translate('ini', $path , $locale);

parse_ini_file() dose not allow to use characters '()'.

http://php.net/manual/en/… {quote} Note: There are reserved words which must not be used as keys for ini files. These include: null, yes, no, true, false, on, off, none. Values null, no and false results in "", yes and true results in "1". Characters {}|&~![()^" must not be used anywhere in the key and have a special meaning in the value. {quote}

Zend_Validate_Ccnum and Zend_Validate_Hostname message uses not allowed characters and should be changed, in my opinion. -Luhn algorithm (mod-10 checksum) failed on '%value%' +Luhn algorithm 'mod-10 checksum' failed on '%value%'

-'%value%' appears to be a DNS hostname but contains a dash ( - ) in an invalid position +'%value%' appears to be a DNS hostname but contains a dash '-' in an invalid position

Regards.

Comments

No issue. The available translation ressources are using the Array adapter. Additionally Ccnum is depreciated as with 1.10 because it have massive security problems.

Thomas, thank you for comments and change Zend_Validate_Hostname message.

Regards.