fabpot/Twig-extensions — pull request #112 by joserobleda (2014-06-26 09:07:11+00:00)
Title: Add support for the --add-comments xgettext parameter

When using the I18n extension in Twig I miss the ability to write comments in the line before the `gettext` call in order to fill the "notes for translator" in the `.po` files. I think this is very useful to put the translator in the right context to make a better translation

I use the reserved word `notes` so a trans expression will look like this:

````
{% trans %}
There is one thing you have to check!
{% plural alerts %}
There are {{ alerts }} things you have to check!
{% notes %}
This refers to a pending actions that the user have to do and will be shown in the home page
{% endtrans %}
````

In poedit you have to add to the parser the parameter like this if you want to read those notes

`xgettext --add-comments=notes`

@fabpot this is the very first time I look into the Twig internals and I don't know if I made a good code, but there are just a few lines to review