babel
babel copied to clipboard
Allow extracting (deeply) nested calls in Python and Javascript
Currently the Python extractor does not support deeply nested gettext calls (deeper than as a direct argument to the top-level gettext call).
e.g.
_("Hello %s", _("Person"))
_("Hello %s",
random_function(", ".join([_("Person 1"), _("Person 2")])))
The extraction code was refactored quite a bit to simplify the flow and support this use-case.
Currently the Javascript extractor does not support nested gettext calls at all.
The extraction code was refactored a bit to resemble the Python code as much as possible and support this use-case.
Fixes https://github.com/python-babel/babel/issues/1125 (meanwhile also fixes https://github.com/python-babel/babel/issues/1123)