I'm wondering if I could get Babel to somehow follow macros to their definition in Jinja templates when extracting messages.
Let's say I have a Jinja template file in my project like so:
{% import 'some_library/components/many_macros.html.j' as many_macros %}
{{ many_macros.test_localization()) }}
And the macro (which sits in a different project/package) is like so:
{% macro test_localization(text=_('color')) %}
<p><b>Content:</b> {{ text }}</p>
{% endmacro %}
Currently Babel does not seem to pick up the string from the default value in the macro definition, despite the Jinja template calling out to it. Is there a way to get 'color' be added to the list of strings that need to be translated without adding all the gettext-marked strings in some_library/components/many_macros.html.j file as well?
I'm wondering if I could get Babel to somehow follow macros to their definition in Jinja templates when extracting messages.
Let's say I have a Jinja template file in my project like so:
And the macro (which sits in a different project/package) is like so:
Currently Babel does not seem to pick up the string from the default value in the macro definition, despite the Jinja template calling out to it. Is there a way to get 'color' be added to the list of strings that need to be translated without adding all the gettext-marked strings in
some_library/components/many_macros.html.jfile as well?