Zend 翻译 Zend 表格!
目前, 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 翻译规范生成一个有效的数组,所以:
$this -> form -> setTranslator(new Zend_Translate($this -> getConfig() -> translation));
预期的结果是 isEmpty 错误现在应该显示为
You must specify your ID
但是我没有得到爱。没有错误,也没有翻译。我使用的是 Zend 1.11.1 和 PHP5.3.5。
Currently, isEmpty errors throw:
Value is required and can't be empty
I'm loading my translator up like this:
[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
The config above produces a valid array according to zend translate spec, so:
$this -> form -> setTranslator(new Zend_Translate($this -> getConfig() -> translation));
expected result is that isEmpty errors should now show up as
You must specify your ID
However I'm getting no love. No errors and no translation. I'm on Zend 1.11.1 and PHP5.3.5.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我认为问题出在 ini 文件中的
english
键上。具体来说,它不应该在那里,因为您实际上作为content
传递给 Zend_Translate 的内容是:它应该是:
希望这会有所帮助。
I think that the problem is with
english
key in your ini file. Specifically it should not be there, because what you are actually passing to Zend_Translate as acontent
is:And it should be:
Hope this will help.
尝试改变
Try to change
您可以在初始化引导程序时使用语言文件(MO)将其简单翻译为多种语言
,一次初始化所选语言
you can user language file(MO) its simple translate in multiple language
when initialize bootstrap at a time initialize selected language