jinja2.ext.InternationalizationExtension.filter_stream

InternationalizationExtension.filter_stream(stream)

It’s passed a TokenStream that can be used to filter tokens returned. This method has to return an iterable of Tokens, but it doesn’t have to return a TokenStream.

In the ext folder of the Jinja2 source distribution there is a file called inlinegettext.py which implements a filter that utilizes this method.