I read the GNU Gettext manual on translating multiple forms and see an example of it:
#, c-format msgid "One file removed" msgid_plural "%d files removed" msgstr[0] "%d slika je uklonjena" msgstr[1] "%d datoteke uklonjenih" msgstr[2] "%d slika uklonjenih"
Why is msgid_plural different from msgid, and doesn't that mean you have translations that know about multiple forms?
I would think I could do something like this (for English):
#, c-format msgid "X geese" msgstr[0] "%d goose" msgstr[1] "%d geese"
(using only one file).
Then in my code I would have something like:
<?php echo $this->translate('X geese', $numberA); ?> <?php echo $this->translate('sentence_about_geese_at_the_lake', $numberB); ?>
If $ numberA is 3, it says "3 geese."
If $ numberB is 0, the next line will say: "There are 0 geese on the lake."
(because for the English rule (n! = 1), so the plural is used for any number that is 0 or greater than 1).
It seems redundant for me to require 2 msgid to be specified for the same set of phrases.
Thank you for your help!
source share