1
0
mirror of https://github.com/django/django.git synced 2025-10-23 21:59:11 +00:00

[5.1.x] Fixed #35306 -- Documented fallback localization formats in templates when localization is disabled.

Backport of 3ac0e43207 from main.
This commit is contained in:
lufafajoshua
2024-06-24 12:02:55 +02:00
committed by Sarah Boyce
parent 63178036b3
commit 3d55f2966d
2 changed files with 12 additions and 5 deletions

View File

@@ -1843,9 +1843,7 @@ standard :term:`language ID format <language code>`. For example, U.S. English
is ``"en-us"``. See also the `list of language identifiers`_ and
:doc:`/topics/i18n/index`.
:setting:`USE_I18N` must be active for this setting to have any effect.
It serves two purposes:
It serves three purposes:
* If the locale middleware isn't in use, it decides which translation is served
to all users.
@@ -1853,6 +1851,11 @@ It serves two purposes:
user's preferred language can't be determined or is not supported by the
website. It also provides the fallback translation when a translation for a
given literal doesn't exist for the user's preferred language.
* If localization is explicitly disabled via the :tfilter:`unlocalize` filter
or the :ttag:`{% localize off %}<localize>` tag, it provides fallback
localization formats which will be applied instead. See
:ref:`controlling localization in templates <topic-l10n-templates>` for
details.
See :ref:`how-django-discovers-language-preference` for more details.