[Django] #25013: Using prefixes for language, the html template code example to switch languages does not work for me.

5 views
Skip to first unread message

Django

unread,
Jun 22, 2015, 5:41:20 AM6/22/15
to django-...@googlegroups.com
#25013: Using prefixes for language, the html template code example to switch
languages does not work for me.
-------------------------------+--------------------
Reporter: wimfeijen | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 1.8
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------
When using i18n_patterns, a prefix is placed for a language. In my
example, I am using 'nl/' and 'en/'.

This does not work well with the example html template code example given
https://docs.djangoproject.com/en/1.8/topics/i18n/translation/#module-
django.conf.urls.i18n

after changing the language from Dutch to English, I am being redirected
to the English page again.

I believe it is the same problem as described here:
http://stackoverflow.com/questions/25548926/change-language-and-its-url-
in-django

Easier for us now seems to use jquery to modify the url in order to switch
languages.

It might be that I am doing something wrong. I am quite capable of doing
that. Cheers!

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

Django

unread,
Jun 22, 2015, 10:21:50 AM6/22/15
to django-...@googlegroups.com
#25013: Using prefixes for language, the html template code example to switch
languages does not work for me.
-------------------------------+--------------------------------------

Reporter: wimfeijen | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 1.8
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by timgraham):

* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0


Comment:

There's a warning for the
[https://docs.djangoproject.com/en/1.8/topics/i18n/translation/#django.views.i18n.set_language
set_language()] docs that says: "Make sure that you don’t include the
above URL within `i18n_patterns()` - it needs to be language-independent
itself to work correctly." Did you follow that advice?

--
Ticket URL: <https://code.djangoproject.com/ticket/25013#comment:1>

Django

unread,
Jun 22, 2015, 10:32:48 AM6/22/15
to django-...@googlegroups.com
#25013: Using prefixes for language, the html template code example to switch
languages does not work for me.
-------------------------------+--------------------------------------

Reporter: wimfeijen | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 1.8
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------

Comment (by wimfeijen):

Yes, I'm using:

{{{

urlpatterns = patterns("",
url(r'^i18n/', include('django.conf.urls.i18n')),
)

urlpatterns += i18n_patterns('',
("^admin/", include(admin.site.urls)),
# etcetera
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/25013#comment:2>

Django

unread,
Jun 22, 2015, 11:14:31 AM6/22/15
to django-...@googlegroups.com
#25013: Using prefixes for language, the html template code example to switch
languages does not work for me.
-------------------------------+--------------------------------------

Reporter: wimfeijen | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 1.8
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------

Comment (by claudep):

An example project would be nice.

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

Django

unread,
Jun 30, 2015, 8:47:26 AM6/30/15
to django-...@googlegroups.com
#25013: Using prefixes for language, the html template code example to switch
languages does not work for me.
-------------------------------------+-------------------------------------
Reporter: wimfeijen | Owner: nobody
Type: Uncategorized | Status: closed
Component: | Version: 1.8
Internationalization |
Severity: Normal | Resolution: needsinfo
Keywords: | Triage Stage:
| Unreviewed

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* status: new => closed
* resolution: => needsinfo
* component: Uncategorized => Internationalization


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

Reply all
Reply to author
Forward
0 new messages