Lines Matching full:gettext
30 The i18n extension can be used in combination with `gettext`_ or
32 marks a block as translatable and calls ``gettext``.
34 After enabling, an application has to provide ``gettext`` and
36 function is added as an alias to the ``gettext`` function.
47 ``translations`` object must implement ``gettext`` and ``ngettext``.
48 :class:`gettext.NullTranslations`, :class:`gettext.GNUTranslations`,
51 .. versionchanged:: 2.5 Added new-style gettext support.
55 Install no-op gettext functions. This is useful if you want to
59 .. versionchanged:: 2.5 Added new-style gettext support.
61 .. method:: jinja2.Environment.install_gettext_callables(gettext, ngettext, newstyle=False)
63 Install the given ``gettext`` and ``ngettext`` callables into the
65 :func:`gettext.gettext` and :func:`gettext.ngettext`.
68 newstyle callables. See :ref:`newstyle-gettext` for more information.
70 .. versionadded:: 2.5 Added new-style gettext support.
85 - ``function`` is the name of the ``gettext`` function used (if
105 for the current configuration, for example by using ``gettext.find``.
110 .. _gettext: https://docs.python.org/3/library/gettext.html target
127 .. _newstyle-gettext:
129 New Style Gettext
134 New style gettext calls are less to type, less error prone, and support
137 You can use "new style" gettext calls by setting
143 With standard ``gettext`` calls, string formatting is a separate step
149 {{ gettext("Hello, World!") }}
150 {{ gettext("Hello, %(name)s!")|format(name=name) }}
155 New style ``gettext`` make formatting part of the call, and behind the
160 {{ gettext("Hello, World!") }}
161 {{ gettext("Hello, %(name)s!", name=name) }}
164 The advantages of newstyle gettext are:
290 Inline ``gettext``
294 to parse calls to the ``_()`` gettext function inline with static data