Opened 3 years ago

Closed 3 years ago

#18700 closed Cleanup/optimization (fixed)

`set_language` view documentation uses hard-coded URL

Reported by: DrMeers Owned by: DrMeers
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 DrMeers 3 years ago.
18700b.diff (2.0 KB) - added by DrMeers 3 years ago.
Forgot quotes
18700c.diff (2.0 KB) - added by DrMeers 3 years ago.
nicer URL name

Download all attachments as: .zip

Change History (11)

comment:1 Changed 3 years ago by DrMeers

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

Already accepted in #18472

Changed 3 years ago by DrMeers

comment:2 Changed 3 years ago by DrMeers

  • Has patch set

Changed 3 years ago by DrMeers

Forgot quotes

comment:3 Changed 3 years ago by claudep

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 follow-up: Changed 3 years ago by 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 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 3 years ago by claudep

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 3 years ago by DrMeers

nicer URL name

comment:6 Changed 3 years ago by DrMeers

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

comment:7 Changed 3 years ago by claudep

  • Triage Stage changed from Accepted to Ready for checkin

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

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

In [10f979fd92000de1ac9713351f5cb749e2cbca03]:

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

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