Re: [Django] #34886: Sample use of lazy in delayed translations is not valid in Django 4.1 and 4.2.

17 views
Skip to first unread message

Django

unread,
Oct 3, 2023, 4:10:32 PM10/3/23
to django-...@googlegroups.com
#34886: Sample use of lazy in delayed translations is not valid in Django 4.1 and
4.2.
-------------------------------+-----------------------------------------
Reporter: Stefan Hammer | Owner: SanjayBisht96
Type: Bug | Status: assigned
Component: Documentation | Version: 4.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+-----------------------------------------
Changes (by SanjayBisht96):

* owner: nobody => SanjayBisht96
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/34886#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Oct 4, 2023, 1:20:47 AM10/4/23
to django-...@googlegroups.com
#34886: Sample use of lazy in delayed translations is not valid in Django 4.1 and
4.2.
-------------------------------+-----------------------------------------
Reporter: Stefan Hammer | Owner: SanjayBisht96
Type: Bug | Status: assigned
Component: Documentation | Version: 4.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+-----------------------------------------

Comment (by Stefan Hammer):

Thanks for the information. I'm also happy that someone assigned itself to
this, because this would be my first contribution and that would take some
time...

But just to be sure: the sample would work in Django 5.0 due to the fix
you've mentioned, but this whole
[https://docs.djangoproject.com/en/dev/topics/i18n/translation/#other-
uses-of-lazy-in-delayed-translations docs] block could actually be removed
for Django >=4.1, because since then `mark_safe()` preserves lazy objects
and therefore a custom helper like that `mark_safe_lazy()` isn't required
anymore. Right?

--
Ticket URL: <https://code.djangoproject.com/ticket/34886#comment:3>

Django

unread,
Oct 4, 2023, 2:28:09 AM10/4/23
to django-...@googlegroups.com
#34886: Sample use of lazy in delayed translations is not valid in Django 4.1 and
4.2.
-------------------------------+-----------------------------------------
Reporter: Stefan Hammer | Owner: SanjayBisht96
Type: Bug | Status: assigned
Component: Documentation | Version: 4.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+-----------------------------------------
Changes (by Mariusz Felisiak):

* cc: Claude Paroz (added)


Comment:

Replying to [comment:3 Stefan Hammer]:


> But just to be sure: the sample would work in Django 5.0 due to the fix
you've mentioned, but this whole
[https://docs.djangoproject.com/en/dev/topics/i18n/translation/#other-
uses-of-lazy-in-delayed-translations docs] block could actually be removed
for Django >=4.1, because since then `mark_safe()` preserves lazy objects
and therefore a custom helper like that `mark_safe_lazy()` isn't required
anymore. Right?

This example could stay but with a different function, or maybe it's not
worth keeping 🤷 Originally it was reported for `mark_safe()`. What do you
think, Claude?

--
Ticket URL: <https://code.djangoproject.com/ticket/34886#comment:4>

Django

unread,
Oct 5, 2023, 11:31:17 AM10/5/23
to django-...@googlegroups.com
#34886: Sample use of lazy in delayed translations is not valid in Django 4.1 and
4.2.
-------------------------------+-----------------------------------------
Reporter: Stefan Hammer | Owner: SanjayBisht96
Type: Bug | Status: assigned
Component: Documentation | Version: 4.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+-----------------------------------------

Comment (by Claude Paroz):

I think we might keep the section by using any string-related method of
the standard lib, like `isascii()` for example.

--
Ticket URL: <https://code.djangoproject.com/ticket/34886#comment:5>

Django

unread,
Mar 8, 2024, 3:09:01 AM3/8/24
to django-...@googlegroups.com
#34886: Sample use of lazy in delayed translations is not valid in Django 4.1 and
4.2.
-------------------------------+------------------------------------
Reporter: Stefan Hammer | Owner: (none)
Type: Bug | Status: new
Component: Documentation | Version: 4.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------
Changes (by Mariusz Felisiak):

* owner: SanjayBisht96 => (none)
* status: assigned => new

--
Ticket URL: <https://code.djangoproject.com/ticket/34886#comment:6>

Django

unread,
May 24, 2024, 9:32:44 AM5/24/24
to django-...@googlegroups.com
#34886: Sample use of lazy in delayed translations is not valid in Django 4.1 and
4.2.
-------------------------------+-----------------------------------------
Reporter: Stefan Hammer | Owner: Lufafa Joshua
Type: Bug | Status: assigned
Component: Documentation | Version: 4.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+-----------------------------------------
Changes (by Lufafa Joshua):

* owner: (none) => Lufafa Joshua
* status: new => assigned

--
Ticket URL: <https://code.djangoproject.com/ticket/34886#comment:7>

Django

unread,
Jun 11, 2024, 9:36:11 AM6/11/24
to django-...@googlegroups.com
#34886: Sample use of lazy in delayed translations is not valid in Django 4.1 and
4.2.
-------------------------------+-----------------------------------------
Reporter: Stefan Hammer | Owner: Lufafa Joshua
Type: Bug | Status: assigned
Component: Documentation | Version: 4.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+-----------------------------------------
Changes (by Lufafa Joshua):

* has_patch: 0 => 1

Comment:

[https://github.com/django/django/pull/18267 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/34886#comment:8>

Django

unread,
Jun 12, 2024, 4:24:37 AM6/12/24
to django-...@googlegroups.com
#34886: Sample use of lazy in delayed translations is not valid in Django 4.1 and
4.2.
-------------------------------+-----------------------------------------
Reporter: Stefan Hammer | Owner: Lufafa Joshua
Type: Bug | Status: assigned
Component: Documentation | Version: 4.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------+-----------------------------------------
Changes (by Sarah Boyce):

* needs_better_patch: 0 => 1

--
Ticket URL: <https://code.djangoproject.com/ticket/34886#comment:9>

Django

unread,
Jun 20, 2024, 2:49:22 AM6/20/24
to django-...@googlegroups.com
#34886: Sample use of lazy in delayed translations is not valid in Django 4.1 and
4.2.
-------------------------------+-----------------------------------------
Reporter: Stefan Hammer | Owner: Lufafa Joshua
Type: Bug | Status: assigned
Component: Documentation | Version: 4.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+-----------------------------------------
Changes (by Lufafa Joshua):

* needs_better_patch: 1 => 0

--
Ticket URL: <https://code.djangoproject.com/ticket/34886#comment:10>

Django

unread,
Jun 24, 2024, 6:24:14 AM6/24/24
to django-...@googlegroups.com
#34886: Sample use of lazy in delayed translations is not valid in Django 4.1 and
4.2.
-------------------------------------+-------------------------------------
Reporter: Stefan Hammer | Owner: Lufafa
| Joshua
Type: Bug | Status: assigned
Component: Documentation | Version: 4.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

* stage: Accepted => Ready for checkin

--
Ticket URL: <https://code.djangoproject.com/ticket/34886#comment:11>

Django

unread,
Jun 25, 2024, 2:59:48 AM6/25/24
to django-...@googlegroups.com
#34886: Sample use of lazy in delayed translations is not valid in Django 4.1 and
4.2.
-------------------------------------+-------------------------------------
Reporter: Stefan Hammer | Owner: Lufafa
| Joshua
Type: Bug | Status: closed
Component: Documentation | Version: 4.2
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce <42296566+sarahboyce@…>):

* resolution: => fixed
* status: assigned => closed

Comment:

In [changeset:"136a5f94099e428dd57572ebd16905fb25ef227e" 136a5f94]:
{{{#!CommitTicketReference repository=""
revision="136a5f94099e428dd57572ebd16905fb25ef227e"
Fixed #34886 -- Modified sample use of lazy in delayed translations.

Modified example to use python standard library function
to lower the case of the string.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/34886#comment:12>

Django

unread,
Jun 25, 2024, 3:02:22 AM6/25/24
to django-...@googlegroups.com
#34886: Sample use of lazy in delayed translations is not valid in Django 4.1 and
4.2.
-------------------------------------+-------------------------------------
Reporter: Stefan Hammer | Owner: Lufafa
| Joshua
Type: Bug | Status: closed
Component: Documentation | Version: 4.2
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Sarah Boyce <42296566+sarahboyce@…>):

In [changeset:"c833cb36a272c9708a9a80ad02e85ca5e2bcc8c2" c833cb3]:
{{{#!CommitTicketReference repository=""
revision="c833cb36a272c9708a9a80ad02e85ca5e2bcc8c2"
[5.1.x] Fixed #34886 -- Modified sample use of lazy in delayed
translations.

Modified example to use python standard library function
to lower the case of the string.

Backport of 136a5f94099e428dd57572ebd16905fb25ef227e from main.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/34886#comment:13>

Django

unread,
Jun 25, 2024, 3:04:41 AM6/25/24
to django-...@googlegroups.com
#34886: Sample use of lazy in delayed translations is not valid in Django 4.1 and
4.2.
-------------------------------------+-------------------------------------
Reporter: Stefan Hammer | Owner: Lufafa
| Joshua
Type: Bug | Status: closed
Component: Documentation | Version: 4.2
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Sarah Boyce <42296566+sarahboyce@…>):

In [changeset:"3a4a44978a09472224f17330ed856c2226b14324" 3a4a4497]:
{{{#!CommitTicketReference repository=""
revision="3a4a44978a09472224f17330ed856c2226b14324"
[5.0.x] Fixed #34886 -- Modified sample use of lazy in delayed
translations.

Modified example to use python standard library function
to lower the case of the string.

Backport of 136a5f94099e428dd57572ebd16905fb25ef227e from main.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/34886#comment:14>
Reply all
Reply to author
Forward
0 new messages