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
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.
Overview Description
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)
This is our Babel config file:
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
_test
pybabel extract
commandActual 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 asgettext("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.Additional Information
Our code repo: https://gitlab.com/liberaforms/liberaforms/-/tree/develop
Our babel config file: https://gitlab.com/liberaforms/liberaforms/-/blob/develop/babel/messages.cfg
A real example of directory starting with underscore: https://gitlab.com/liberaforms/liberaforms/-/tree/develop/liberaforms/templates/form/_partials
The text was updated successfully, but these errors were encountered: