• Home
  • Raw
  • Download

Lines Matching +full:- +full:gettext

30 # provides ugettext, it will be assigned to gettext.
31 GETTEXT_FUNCTIONS = ("_", "gettext", "ngettext")
138 return __context.call(__context.resolve("gettext"), *args, **kwargs)
143 def gettext(__context, __string, **variables): function
152 return gettext
162 # Always treat as a format string, see gettext comment above.
169 """This extension adds gettext support to Jinja."""
177 # something is called twice here. One time for the gettext value and
178 # the other time for the n-parameter of the ngettext function.
195 gettext = getattr(translations, "ugettext", None)
196 if gettext is None:
197 gettext = translations.gettext
201 self._install_callables(gettext, ngettext, newstyle)
208 def _install_callables(self, gettext, ngettext, newstyle=None): argument
212 gettext = _make_new_gettext(gettext)
214 self.environment.globals.update(gettext=gettext, ngettext=ngettext)
217 for key in "gettext", "ngettext":
382 # gettext invocations only if there are vars.
390 gettext = nodes.Name("gettext", "load")
391 node = nodes.Call(gettext, [nodes.Const(singular)], [], None, None)
404 # in case newstyle gettext is used, the method is powerful
470 .. code-block:: html+jinja
474 .. code-block:: text
514 gettext functions that allow keyword arguments for placeholder expansion.
517 in tuples. As a consequence invalid gettext calls (calls without a single
518 string parameter or string parameters after non-string parameters) are
535 * ``function`` is the name of the ``gettext`` function used (if the
579 find comments for gettext calls forwards. Once the comment
623 gettext call in one line of code and the matching comment in the
628 gettext calls.
634 :param fileobj: the file-like object the messages should be extracted from
679 source = fileobj.read().decode(options.get("encoding", "utf-8"))