class documentation
This extension adds gettext support to Jinja.
Method | __init__ |
Undocumented |
Method | parse |
Parse a translatable tag. |
Class Variable | tags |
Undocumented |
Method | _extract |
Undocumented |
Method | _install |
Undocumented |
Method | _install |
Undocumented |
Method | _install |
Undocumented |
Method | _make |
Generates a useful node from the data provided. |
Method | _parse |
Parse until the next block tag with a given name. |
Method | _trim |
Undocumented |
Method | _uninstall |
Undocumented |
Inherited from Extension
:
Method | __init |
Undocumented |
Method | attr |
Return an attribute node for the current extension. This is useful to pass constants on extensions to generated template code. |
Method | bind |
Create a copy of this extension bound to another environment. |
Method | call |
Call a method of the extension. This is a shortcut for :meth:`attr` + :class:`jinja2.nodes.Call`. |
Method | filter |
It's passed a :class:`~jinja2.lexer.TokenStream` that can be used to filter tokens returned. This method has to return an iterable of :class:`~jinja2.lexer.Token`\s, but it doesn't have to return a :class:`~jinja2... |
Method | preprocess |
This method is called before the actual lexing and can be used to preprocess the source. The `filename` is optional. The return value must be the preprocessed source. |
Class Variable | identifier |
Undocumented |
Class Variable | priority |
Undocumented |
Instance Variable | environment |
Undocumented |
overrides
jinja2.ext.Extension.parse
Parse a translatable tag.
Parameters | |
parser:Parser | Undocumented |
Returns | |
t.Union[ | Undocumented |
Undocumented
Parameters | |
source:t.Union[ | Undocumented |
gettextt.Sequence[ | Undocumented |
Returns | |
t.Iterator[ | Undocumented |
Undocumented
Parameters | |
translations:_SupportedTranslations | Undocumented |
newstyle:t.Optional[ | Undocumented |
def _install_callables(self, gettext, ngettext, newstyle=None, pgettext=None, npgettext=None):
(source)
Undocumented
Parameters | |
gettext:t.Callable[ | Undocumented |
ngettext:t.Callable[ | Undocumented |
newstyle:t.Optional[ | Undocumented |
pgettext:t.Optional[ | Undocumented |
npgettext:t.Optional[ | Undocumented |
def _make_node(self, singular, plural, context, variables, plural_expr, vars_referenced, num_called_num):
(source)
Generates a useful node from the data provided.
Parameters | |
singular:str | Undocumented |
plural:t.Optional[ | Undocumented |
context:t.Optional[ | Undocumented |
variables:t.Dict[ | Undocumented |
pluralt.Optional[ | Undocumented |
varsbool | Undocumented |
numbool | Undocumented |
Returns | |
nodes.Output | Undocumented |