I've read the GNU Gettext manual about Translating plural forms and see its example:
#, 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 defeat the purpose of having translations be aware of plural forms?
I'd think that I could do something like this (for English):
#, c-format
msgid "X geese"
msgstr[0] "%d goose"
msgstr[1] "%d geese"
#, c-format
msgid "sentence_about_geese_at_the_lake"
msgstr[0] "There is one goose at the lake."
msgstr[1] "There are %d geese at the lake."
(using just one msgid).
Then in my code, I'd 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 would say "3 geese."
If $numberB is 0, the next line would say "There are 0 geese at the lake."
(because for English, the rule is (n != 1), so plural is used for any number that equals 0 or greater than 1).
It seems redundant for me to be required to specify 2 msgids for the same collection of phrases.
Thanks for your help!