#20398 closed Cleanup/optimization (fixed)
Language select code suggestion
Reported by: | ggbaker | Owned by: | nobody |
---|---|---|---|
Component: | Documentation | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
I was just looking at the example template snippet where the user can select their language:
https://docs.djangoproject.com/en/dev/topics/i18n/translation/#the-set-language-redirect-view
I'd suggest that the <option> tag change from this:
<option value="{{ language.code }}">
to this:
<option value="{{ language.code }}"{% if language.code == LANGUAGE_CODE %} selected="selected"{% endif %}>
I think that's much nicer (since I suspect a lot of people copy those code snippets without looking too closely).
Change History (6)
comment:1 by , 12 years ago
Easy pickings: | set |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:2 by , 12 years ago
comment:3 by , 12 years ago
Has patch: | set |
---|
comment:4 by , 12 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
Patch looks good.
I'm marking this as ready for checkin.
Thanks.
comment:5 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Pull request is available here: https://github.com/django/django/pull/1057