0

I am building a multi-language site and present my text in the form _('mytext') or _("mytext") so that Poedit can recognize it and add it to my pending translations. Why is the text below not recognized unless I remove the : {$form->getValue('email')} part? How can I modify this so Poedit picks it up?

$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"))
            );
dimbo
  • 817
  • 1
  • 11
  • 25

1 Answers1

0

The solution seems easy:

$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"))
        );

As to the why, I'm not sure, but it does not seem like a good idea that anybody could inject php variables using a program like poedit.

jeroen
  • 91,079
  • 21
  • 114
  • 132
  • Thanks. I don't actually see the security hole. The application just reads the appropriate translation from the poedit .po file which is outside of the public view. Am I missing something? – dimbo Dec 16 '11 at 18:22