You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Files in directories starting with underscore (_) are not extratcted into .POT #1024
We are using PyBabel for i18n in our software and Jinja2 extension for HTML files. However, files which are located in directories starting with an underscore, e.g. _partials, are not extracted into the .pot file, even if the rest of directories are taken into account.
It happens both with .py files and in .html files (using Jinja2)
I also tried pointing to the exact file by including the whole path into the Babel config file.
Is the character _ excluded from **?
Steps to Reproduce
Create a directory starting with an underscore, e.g. _test
Reference the directory in your Babel config file
Run pybabel extract command
Check your updated .pot file: the i18n-ed strings in those directories won't be in the .pot
Actual Results
The files under directories starting with underscore are not included into .pot
If you change the directory name to start with hyphen (-), the file is included.
No matter whether strings are i18n-ed as _("string") or as gettext("string")
Expected Results
If using ** in the Babel config should include all directories (as documentation points out), also directories starting with underscore should be included.
Activity
akx commentedon Oct 1, 2023
See #832 – you should be able to use
--ignore-dirs=.*to remove the default_*directory ignore filter.