I am working through Miguel Grinberg's new Flask tutorial and have made it to i18n/l10n. Half this chapter had been a headache.
First, pybabel extract -F babel.cfg -k _l -o messages.pot
doesn't run. All I get is: pybabel: error: no input files or directories specified
Whatever, quick Google search says: pybabel extract -F babel.cfg -k _l -o messages.pot --input-dir=.
will work. It does.
I see all the files it's supposed to be extracting from in the readout.
...
extracting messages from app/routes.py
extracting messages from app/templates/404.html (extensions="jinja2.ext.autoescape,jinja2.ext.with_")
...
Alight, on to generating the language catalog. pybabel init -i messages.pot -d app/translations -l es
runs without error and looks good when I open the file. I start copy/pasting translations when I notice my messages.po
file is 100 lines shorter than Miguel's.
I looked closer at my version of the file and found that while pybabel may have looked into all of my files, it didn't extract anything from some.
I can only speculate that adding --input-dir=.
may have changed things but I couldn't get pybabel to run without it and Googling pybabel extract babel.cfg messages.pot "no input files"
returns 3 results all mentioning making that change.
For anyone familiar with the Mega Tutorial, pybabel isn't extracting anything from my base.html
, _post.html
, or user.html
files.