Lines Matching full:gettext
33 # the only real useful gettext functions for a Jinja template. Note
34 # that ugettext must be assigned to gettext as Jinja doesn't support
36 GETTEXT_FUNCTIONS = ("_", "gettext", "ngettext")
144 return __context.call(__context.resolve("gettext"), *args, **kwargs)
149 def gettext(__context, __string, **variables): function
158 return gettext
168 # Always treat as a format string, see gettext comment above.
175 """This extension adds gettext support to Jinja."""
183 # something is called twice here. One time for the gettext value and
199 gettext = getattr(translations, "ugettext", None)
200 if gettext is None:
201 gettext = translations.gettext
205 self._install_callables(gettext, ngettext, newstyle)
212 def _install_callables(self, gettext, ngettext, newstyle=None): argument
216 gettext = _make_new_gettext(gettext)
218 self.environment.globals.update(gettext=gettext, ngettext=ngettext)
221 for key in "gettext", "ngettext":
386 # gettext invocations only if there are vars.
394 gettext = nodes.Name("gettext", "load")
395 node = nodes.Call(gettext, [nodes.Const(singular)], [], None, None)
408 # in case newstyle gettext is used, the method is powerful
518 gettext functions that allow keyword arguments for placeholder expansion.
521 in tuples. As a consequence invalid gettext calls (calls without a single
539 * ``function`` is the name of the ``gettext`` function used (if the
583 find comments for gettext calls forwards. Once the comment
627 gettext call in one line of code and the matching comment in the
632 gettext calls.