Studyon Minte9.com
ZF 1.0




Translation



#modules/default/controllers/FrontendController.php
<?php
...
public function loginAction() {

	$form = new Forms_Login();
	if ($this->_request->isPost()) {
		if ($form->isValid($this->_request->getParams())) {
		}
	}
}

#modules/default/Forms/Login.php
	...
	$username = new Zend_Form_Element_Text('username', array(
		'required' => true,
	));


#Application/translations/en.php
<?php
$translationArray = array(
	'YES' => 'Da',
	'isEmpty' => 'Valoare necompletata',
	'stringLengthTooShort' => "'%value%' mai putin de %min% caractere lungime",
);

#Zend_Validate_NotEmpty
const IS_EMPTY = 'isEmpty';

#Zend_Validate_StringLength
const TOO_SHORT = 'stringLengthTooShort';


---
form.01.overview
translate.overview


http://cogo.wordpress.com/2008/04/24/translating-zend_form-error-messages-and-more/

form custom error message
http://framework.zend.com/manual/en/zend.form.elements.html