Lines Matching full:gettext
28 # the only real useful gettext functions for a Jinja template. Note
29 # that ugettext must be assigned to gettext as Jinja doesn't support
31 GETTEXT_FUNCTIONS = ('_', 'gettext', 'ngettext')
134 return __context.call(__context.resolve('gettext'), *args, **kwargs)
139 def gettext(__context, __string, **variables): function
144 return gettext
159 """This extension adds gettext support to Jinja2."""
166 # something is called twice here. One time for the gettext value and
182 gettext = getattr(translations, 'ugettext', None)
183 if gettext is None:
184 gettext = translations.gettext
188 self._install_callables(gettext, ngettext, newstyle)
197 def _install_callables(self, gettext, ngettext, newstyle=None): argument
201 gettext = _make_new_gettext(gettext)
204 gettext=gettext,
209 for key in 'gettext', 'ngettext':
361 # gettext invocations only if there are vars.
369 gettext = nodes.Name('gettext', 'load')
370 node = nodes.Call(gettext, [nodes.Const(singular)],
382 # in case newstyle gettext is used, the method is powerful
443 gettext functions that allow keyword arguments for placeholder expansion.
446 in tuples. As a consequence invalid gettext calls (calls without a single
464 * ``function`` is the name of the ``gettext`` function used (if the
507 find comments for gettext calls forwards. Once the comment
550 gettext call in one line of code and the matching comment in the
555 gettext calls.