Hi Vinay,
There's a typo in your template example (malformed tag in "{% trans}
This should "), but I assume it's not the problem. I think you are
missing the -F option to pybabel : pybabel -v extract -F babel.cfg
mymodule -o mymodule.pot
At least I reproduced your problem and fixed it this way.
Regards,
On Feb 16, 11:56 pm, Vinay Sajip <[email protected]> wrote:
> On Feb 16, 5:01 pm, Armin Ronacher <[email protected]>
> wrote:
>
> Hi Armin,
>
> > Try with just **.html for a moment. If that does not work, check if the
> > entrypoint is registered. Should yield something like this:
>
> > >>> from pkg_resources import iter_entry_points
> > >>> for ep in iter_entry_points('babel.extractors'):
> > ... print ep
> > ...
> > jinja2 = jinja2.ext:babel_extract [i18n]
> > mako = mako.ext.babelplugin:extract
> > genshi = genshi.filters.i18n:extract [i18n]
>
> I tried both things:
>
> #-------------------------------------
> (scratch)vinay:~/projects/scratch$ cat babel.cfg
> [python: **.py]
>
> [jinja2: **.html]
> encoding = utf-8
>
> (scratch)vinay:~/projects/scratch$ pybabel -v extract mymodule -o
> mymodule.pot
> extracting messages from mymodule/__init__.py
> writing PO template file to mymodule.pot
> #-------------------------------------
>
> i.e. the same result as before. I checked the babel.extractors entry
> points:
> #------------------------------------->>> from pkg_resources import
> iter_entry_points
> >>> for ep in iter_entry_points('babel.extractors'):
>
> ... print ep
> ...
> ignore = babel.messages.extract:extract_nothing
> python = babel.messages.extract:extract_python
> javascript = babel.messages.extract:extract_javascript
> jinja2 = jinja2.ext:babel_extract [i18n]
>
> #-------------------------------------
>
> So, the Jinja extractor certainly appears to be registered. As I used
> virtualenv, it installed setuptools automatically, and that's what I
> used to install Babel and Jinja2 (in that order). There's no other
> libraries in the virtualenv, so I can't see what the problem might be.
> Both Babel and Jinja2 installed without problems. BTW, I'm running
> Python 2.6 on Ubuntu Karmic. Jinja version is 2.3, Babel version is
> 0.9.4.
>
> Any other suggestions?
>
> Regards,
>
> Vinay
--
You received this message because you are subscribed to the Google Groups
"pocoo-libs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/pocoo-libs?hl=en.