Tinker
Tinker

Reputation: 4535

Flask-babel unable to recognize _ or gettext

I have the following in my template:

<a class="page-scroll" href="#career">{{ _(Career) }}</a>
<a class="page-scroll" href="{{ url_for("comment_new") }}">{{ gettext(Contact) }}</a>
<a href="#" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">{% trans %}Language{% endtrans %}</a>

When I run pybabel extract -F babel.cfg -o messages.pot .

I am only seeing:

#: templates/hello.html:91
msgid "Language"
msgstr ""

but not "Career" or "Language". I can't figure out why babel is not interpreting _ or gettext in jinja. Help?

Upvotes: 0

Views: 323

Answers (1)

Tinker
Tinker

Reputation: 4535

ah turns out I need "" even in jinja. n00b!

Upvotes: 1

Related Questions