Opened 4 years ago

Closed 4 years ago

#18700 closed Cleanup/optimization (fixed)

`set_language` view documentation uses hard-coded URL

Reported by: Simon Meers Owned by: Simon Meers
Component: Documentation Version: 1.4
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

As reported in #18472, the form action should use URL reversal.

Attachments (3)

18700.diff (2.0 KB) - added by Simon Meers 4 years ago.
18700b.diff (2.0 KB) - added by Simon Meers 4 years ago.
Forgot quotes
18700c.diff (2.0 KB) - added by Simon Meers 4 years ago.
nicer URL name

Download all attachments as: .zip

Change History (11)

comment:1 Changed 4 years ago by Simon Meers

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
Triage Stage: UnreviewedAccepted

Already accepted in #18472

Changed 4 years ago by Simon Meers

Attachment: 18700.diff added

comment:2 Changed 4 years ago by Simon Meers

Has patch: set

Changed 4 years ago by Simon Meers

Attachment: 18700b.diff added

Forgot quotes

comment:3 Changed 4 years ago by Claude Paroz

What about using 'set_language' as view name?

I think that we should also use the url template tag in the form action url in https://docs.djangoproject.com/en/dev/topics/i18n/translation/#django.conf.urls.i18n.set_language

comment:4 Changed 4 years ago by Simon Meers

What about using 'set_language' as view name?

Yes, I agree. setlang irked me, but I thought I should match it. I'd like to change the URLconf to use /set-language/ too, but backwards-compatibility might pose problems (which is exactly why we *don't* use hardcoded URLs, especially in official documentation!)

I think that we should also use the url template tag in the form action url

That link seems to be the one that I've already patched?

comment:5 in reply to:  4 Changed 4 years ago by Claude Paroz

Replying to DrMeers:

What about using 'set_language' as view name?

Yes, I agree. setlang irked me, but I thought I should match it. I'd like to change the URLconf to use /set-language/ too, but backwards-compatibility might pose problems (which is exactly why we *don't* use hardcoded URLs, especially in official documentation!)

I'm not particularly shocked by the setlang (URL)/set_language (View name) difference.

I think that we should also use the url template tag in the form action url

That link seems to be the one that I've already patched?

/o\ sorry!

Changed 4 years ago by Simon Meers

Attachment: 18700c.diff added

nicer URL name

comment:6 Changed 4 years ago by Simon Meers

I'll leave this open for a couple more days before committing it.

comment:7 Changed 4 years ago by Claude Paroz

Triage Stage: AcceptedReady for checkin

comment:8 Changed 4 years ago by Simon Meers <simon@…>

Resolution: fixed
Status: newclosed

In [10f979fd92000de1ac9713351f5cb749e2cbca03]:

Fixed #18700 -- Added URL reversal for i18n set_language view.

Note: See TracTickets for help on using tickets.
Back to Top