cakephp/cakephp — pull request #5347 by jiru (2014-12-06 22:57:55+00:00)
Title: Properly parse Plural-Forms header of PO/MO files

I ran into the problem that pluralized strings were not displayed in Arabic. Arabic uses 6 plural forms and its formula wasn’t handled by `I18n::_pluralGuess()`. Since I don’t want to run into more troubles with unhandled plural forms, I implemented a proper parser. It first converts the expression to postfix using a [shunting-yard algorithm](https://en.wikipedia.org/wiki/Shunting-yard_algorithm), and then evaluates it each time a pluralized string is translated. I did not write so much tests since the I18n tests already make an extensive use of plural strings.