python-babel / babel

The official repository for Babel, the Python Internationalization Library
http://babel.pocoo.org/
BSD 3-Clause "New" or "Revised" License
1.32k stars 440 forks source link

jinja2 tags in template file breaks pybabel extraction #93

Closed m3dwards closed 10 years ago

m3dwards commented 10 years ago

Putting either {% %} or {% formfill form_data with errors %} in a jijnja2 template file breaks pybabel extraction. Removing those from a template file and the extration works as expected.

Steps to recreate:

Create a template file that looks like

{% import "form_macros.html" as form %}
{% %}
<h1> {{ _('Home') }} </h1>

and then run pybabel extract on it. Home will not be extracted.

If you remove the {% %} from the file it will work.

m3dwards commented 10 years ago

I needed to make my config file to look like:

[python: **.py]
[jinja2: templates/**.*]
extensions=jinja2.ext.autoescape,jinja2.ext.with_,formencode_jinja2.formfill