fabpot/Twig-extensions — pull request #76 by deceze (2012-12-24 12:33:03+00:00)
Title: Gettext extension

As suggested in issue #75, the gettext integration through the i18n extension is very limited. I have added a new Gettext extension, which provides all the bells and whistles of the gettext library. Please see the updated docs for a full rundown of usage and features.

The extractor is implemented with the native `Twig_Lexer` and `Twig_Parser`, but extends the Lexer and Token classes in order to preserve and extract comment nodes. This is arguably somewhat hackie and it produces extra files in the `Extensions/Extension/Gettext` folder, please advise if there's a better way to organize this or hook into the whole process.

I have published the tools for writing POT files at https://github.com/deceze/Kunststube-POTools and have included an adapter here. I have done so since these tools have a use beyond Twig and bundling them into Twig seems inappropriate. It also allows users to hook in a different toolchain if desired. Please advise if you have specific requirements for such bundling/external libraries.

I just wonder in how far the existing i18n extension should be replaced by/merged into this.