From: Aarni Koskela Date: Tue, 10 Sep 2024 15:23:08 +0000 (+0300) Subject: Improve documentation for initializing the i18n extension X-Git-Tag: 3.1.5~35^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F2023%2Fhead;p=thirdparty%2Fjinja.git Improve documentation for initializing the i18n extension Refs discussion at https://stackoverflow.com/a/78970088 --- diff --git a/docs/extensions.rst b/docs/extensions.rst index 45ead3b7..9b15e813 100644 --- a/docs/extensions.rst +++ b/docs/extensions.rst @@ -39,6 +39,10 @@ After enabling, an application has to provide functions for ``gettext``, globally or when rendering. A ``_()`` function is added as an alias to the ``gettext`` function. +A convenient way to provide these functions is to call one of the below +methods depending on the translation system in use. If you do not require +actual translation, use ``Environment.install_null_translations`` to +install no-op functions. Environment Methods ~~~~~~~~~~~~~~~~~~~