I use Poedit for my gettext i18n and that works fine. I use ZF2 where there are view helpers to integrate the translations. One is translate
, the other translatePlural
.
Usage:
<?php echo $this->translate('Welcome') ?>
<?php echo $this->translatePlural('Item', 'Items', $number) ?>
In Poedit I add the keywords translate
and translatePlural
. The normal translations work fine, but for the plural forms, only the "Item" is found (and not the "Items"). Just for testing purposes, I replaced the $this->translatePlural()
call with ngettext()
, but I end up with the same result. My conclusion: (my version of) Poedit is unable to scan plural forms.
What should I enter as keyword to let Poedit scan the second string as well?
After some further search, I stumbled upon the syntax [function]:1,2
. That did the trick for me. I have now identified these two functions as keywords for Poedit as follows:
translate
translatePlural:1,2
And now my second argument is scanned.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With