0

我正在构建一个多语言网站,并以 _('mytext') 或 _("mytext") 的形式显示我的文本,以便 Poedit 可以识别它并将其添加到我的待翻译翻译中。除非我删除 : 部分,否则为什么无法识别下面的文本{$form->getValue('email')}?我该如何修改它以便 Poedit 选择它?

$this->view->errors = array(
              array(_("{$form->getValue('email')} is already registered with this site. If you have
              forgotten your password, click on the link and we will send you a new one"))
            );
4

1 回答 1

0

解决方案似乎很简单:

$this->view->errors = array(
          array($form->getValue('email') . _(" is already registered with this site. If you have
          forgotten your password, click on the link and we will send you a new one"))
        );

至于为什么,我不确定,但任何人都可以使用 poedit 之类的程序注入 php 变量似乎不是一个好主意。

于 2011-12-16T17:21:21.010 回答