cakephp/cakephp — pull request #4086 by lorenzo (2014-07-25 22:51:35+00:00)
Title: 3.0 i18n next

This is my proposal for the new I18n layer in version 3.0. These are the main highlights

* Internally uses https://github.com/auraphp/Aura.Intl , I found that is was a better fit for us than the symfony translate component
* Each domain/locale combination is stored in a separate translator class
* Translators can be create programatically on the fly. Factories take a callable, making it easy to implement your own translation engines
* Plural selection is not dependent of a file header anymore, but depends on the actual locale.
* Uses the intl message format for interpolating variables and optionally selecting plurals.
* There is an option to just us a sprintf variables interpolator
* `__c`, `__dc` and `__dcn` are gone. Basically the idea of categories is gone

There are a few rough edges that I would like to solve later, but I wanted some feedback before this grows more.

Todo:
* [ ] A better way of selecting the custom formatter function per translator
* [ ] Cache messages after being parsed and cached MessageFormat classes for performance
* [ ] A Dispatcher filter to select the locale based on headers
* [ ] A few more tests on the __* functions
* [ ] Remove the need for a `LC_MESSAGES` folder