I am trying to use Zend_translate in a situation where I need to insert the value of a variable into the resulting string and contain the string as a plural form. Using the regular (not multiple) helper of the $ this-> translate () view in the script view, I can insert the variable into the string:
$this->translate('You have %1$s questions to answer', 3)
But how do I do this using what Zend calls the modern multiple signage method? Apparently the view helper $ this-> translate () itself does not support multiple notation, instead I have to call
$this->translate()->getTranslator()->translate( array('You have %1$s question to answer', 'You have %1$s questions to answer', $someNr ) )
But at this moment I only have a multiple line with a placeholder variable, I do not have a line with the entered value. In other words, I get:
You have% 1 $ s questions to answer
I want to
You have 2 questions to answer.
So the question is, does Zend_Translate support this plural way? That is, insert a variable value into a string with pluralization? Or do I need to go with line splitting before and after the plural form, translate each individually and then concatenate at the output?
source share