【问题标题】:Zend_Translate: Is there an easy way to use traditional plural translating in Zend_View?Zend_Translate:在 Zend_View 中是否有一种简单的方法可以使用传统的复数翻译?
【发布时间】:2012-02-02 17:08:41
【问题描述】:

我们都知道你可以在你的 zend 视图中调用$this->translate() 来翻译一个字符串。但是,传统形式的复数翻译是否也有这样的捷径(以便poedit可以阅读)还是我必须通过Zend_Registry::get('Zend_Translate')->plural()去?

【问题讨论】:

  • 发现我可以为它编写自己的助手(因为 translate 本身就是一个助手),但也许你已经知道一个现有的实现。

标签: zend-framework


【解决方案1】:

这可以通过在视图中调用getTranslator() 来实现:

$this->translate()->getTranslator()->plural('singular', 'plural', $count);

【讨论】:

    猜你喜欢
    • 2013-09-28
    • 2020-10-09
    • 2013-07-29
    • 1970-01-01
    • 1970-01-01
    • 2012-07-08
    • 2023-03-20
    • 2020-03-18
    • 2012-12-03
    相关资源
    最近更新 更多