目前,isEmpty错误抛出:
Value is required and can't be empty我像这样加载我的翻译器:
[translation]
adapter = array
content.english["emailNotUnique"] = "Your user already exists"
content.english["Value is required and can't be empty"] = "You must specify your ID"
locale = en上面的配置根据zend translate规范生成一个有效的数组,因此:
$this -> form -> setTranslator(new Zend_Translate($this -> getConfig() -> translation));预期的结果是isEmpty错误现在应该显示为
You must specify your ID然而,我没有得到爱。没有错误,也没有翻译。我使用的是Zend 1.11.1和PHP5.3.5。
发布于 2011-02-21 22:54:23
我认为问题出在你的ini文件中的english密钥。具体地说,它不应该在那里,因为您实际作为content传递给Zend_Translate的是:
'content' => array(
'english' => array(
"emailNotUnique" => 'Your user already exists' ,
"Value is required and can't be empty" => 'You must specify your ID'
)
);它应该是:
'content' => array(
"emailNotUnique" => 'Your user already exists' ,
"Value is required and can't be empty" => 'You must specify your ID'
);希望这能有所帮助。
发布于 2011-02-21 22:30:04
试着改变
content.english["isEmpty"] = "You must specify your ID"发布于 2014-01-24 20:08:13
你可以将用户语言文件(MO)简单地翻译成多种语言
每次初始化bootstrap时初始化选定语言
https://stackoverflow.com/questions/5065838
复制相似问题