Code

Opened 3 years ago

Closed 3 years ago

Last modified 2 years ago

#16072 closed Bug (fixed)

Using multiple expressions inside a blocktrans tag not working as documented

Reported by: ivan.mincik@… Owned by: nobody
Component: Documentation Version: 1.3
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

According 1.3 docs, using multiple expressions inside a blocktrans tag should be done using following statement:

{% blocktrans with book_t=book|title and author_t=author|title %}
This is {{ book_t }} by {{ author_t }}
{% endblocktrans %}

but it is not working.

This works in my case:

{% blocktrans with book|title as book_t and author|title as author_t %}
This is {{ book_t }} by {{ author_t }}
{% endblocktrans %}

Attachments (0)

Change History (8)

comment:1 Changed 3 years ago by jezdez

  • Component changed from Template system to Documentation
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

Yeah, this is a documentation bug according to SmileyChris should be:

{% blocktrans with book_t=book|title author_t=author|title %}
This is {{ book_t }} by {{ author_t }}
{% endblocktrans %}

comment:2 Changed 3 years ago by SmileyChris

  • Resolution set to fixed
  • Status changed from new to closed

In [16268]:

Fixes #16072 -- incorrect documentation for multiple expressions inside a blocktrans tag

comment:3 Changed 3 years ago by SmileyChris

In [16269]:

(The changeset message doesn't reference this ticket)

comment:4 Changed 3 years ago by glund@…

  • Resolution fixed deleted
  • Status changed from closed to reopened
  • UI/UX unset

Hello, this is still broken in the 1.3 docs.

It looks to me like [16269] applied the fix in reverse somehow?! The trunk docs look fine.

comment:5 Changed 3 years ago by julien

  • Resolution set to fixed
  • Status changed from reopened to closed

Well spotted, [16269] should have removed the "and" in the code sample. However, the new policy is to not make any fixes in the last minor release unless it's a critical bug, which it is not. See https://docs.djangoproject.com/en/dev/internals/release-process/#supported-versions

For that reason I'm re-closing as "Fixed" since it is effectively fixed in trunk. Thanks for bringing this up nonetheless.

comment:6 Changed 2 years ago by glund@…

With respect this is a documentation bug, I don't really see how not having correct documentation for the current supported release was the intention of that policy. The result of which was much lost time for us.

The code sample is the only description of the syntax concerned, it is not a 'nice to have extra' in this case.

What is the review process here, it seems absurd to have to raise this matter elsewhere but it is essential for our use of Django that the docs for the current version are correct.

comment:7 Changed 2 years ago by carljm

In [17011]:

[1.3.X] Refs #16072 -- Corrected blocktrans multiple-argument syntax example in the docs.

comment:8 Changed 2 years ago by carljm

I agree that the "critical fixes only" backporting policy does not apply to doc fixes. The release-process docs do need to be updated to mention that, however; filed #17068 for that.

I made this fix in the 1.3.X branch. Thanks glund for the report.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.