Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not extracting strings from some files #52

Closed
osleg opened this issue Jan 23, 2014 · 7 comments
Closed

Not extracting strings from some files #52

osleg opened this issue Jan 23, 2014 · 7 comments

Comments

@osleg
Copy link

osleg commented Jan 23, 2014

I have a base.html file and navbar.html file.
The navbar.html is included in base.html and base extended in other templates.
The problem is that babel does not extract strings from navbar.html even though i can see it read it.

extraction log


babel.cfg

[jinja2: **.htm*]
encoding = utf-8
extensions=jinja2.ext.autoescape,jinja2.ext.with_

What could be the problem?

@osleg
Copy link
Author

osleg commented Jan 23, 2014

@jessepollak
Copy link

If you set slient=false under the [jinja2] section, you may get more information on why it's failing. I had the same problem and it turned out that I didn't have all the necessary jinja2 extensions registered (I was using webassets, which creates an {% assets %} tag.

Hope this helps!

@m3dwards
Copy link

m3dwards commented May 6, 2014

@jessepollak I have an almost identical problem with formencode. How do you register the jinja2 extensions for pybabel extract?

Many thanks

@m3dwards
Copy link

m3dwards commented May 6, 2014

Think I have it, I changed my config file to this:

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

@jessepollak
Copy link

My config looks like this.

[jinja2: /templates/.html]
extensions=jinja2.ext.autoescape,jinja2.ext.with_,webassets.ext.jinja2.AssetsExtension,jinja2_highlight.highlight.HighlightExtension
encoding = utf-8
silent=false
[extractors]
jinja2 = jinja2.ext:babel_extract

@danbruegge
Copy link

@jessepollak thanks for the webassets hint. :)

@TkTech TkTech closed this as completed May 26, 2016
@digitalformula
Copy link

If you set slient=false under the [jinja2] section, you may get more information on why it's failing. I had the same problem and it turned out that I didn't have all the necessary jinja2 extensions registered (I was using webassets, which creates an {% assets %} tag.

Hope this helps!

Wow, almost 5 years later and this reply just solved the exact issue I was having. Freakin' brilliant - thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants