Discussion:
Can't get i18n/setLang to match any urls
Shawn H
2014-05-14 21:45:43 UTC
Permalink
I'm beginning the process of adding some translations to one public page,
and I can't get my setLang url to match, getting a 404 instead. I've got
USE_I18N = True in my settings. I've got
'django.core.context_processors.i18n', in my TEMPLATE_CONTEXT_PROCESSORS.
Copied the directly from the docs, version 1.6

My urls.py

from django.conf.urls import patterns, include, url
from sdcgis import settings

urlpatterns = patterns('',

#index
url('^sdc/home/',include('sdc_home.urls', namespace='sdc_home')),

#user language
(r'^i18n/', include('django.conf.urls.i18n')),

#I tried url(r'^i18n/', include('django.conf.urls.i18n')), too, with no
luck

...


I'm making an jQuery post:

var data = {'name':'language', 'value':'en-us'};



$.post('/i18n/setLang/', data, function() {

});

My browser says I'm requesting via POST http://localhost/i18n/setLang/,
with form data of name: language and value:en-us. I get 404. What am I
missing?
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+***@googlegroups.com.
To post to this group, send email to django-***@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/3b337b77-d909-41f1-9cdb-b12dde6b703d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Kelvin Wong
2014-05-17 06:04:45 UTC
Permalink
The L in setLang should be setlang as in the L is lowercase
From my Django log "POST /i18n/setlang/ HTTP/1.1" 302 0
K
I'm beginning the process of adding some translations to one public page,
and I can't get my setLang url to match, getting a 404 instead. I've got
USE_I18N = True in my settings. I've got
'django.core.context_processors.i18n', in my TEMPLATE_CONTEXT_PROCESSORS.
Copied the directly from the docs, version 1.6
My urls.py
from django.conf.urls import patterns, include, url
from sdcgis import settings
urlpatterns = patterns('',
#index
url('^sdc/home/',include('sdc_home.urls', namespace='sdc_home')),
#user language
(r'^i18n/', include('django.conf.urls.i18n')),
#I tried url(r'^i18n/', include('django.conf.urls.i18n')), too, with no
luck
...
var data = {'name':'language', 'value':'en-us'};
$.post('/i18n/setLang/', data, function() {
});
My browser says I'm requesting via POST http://localhost/i18n/setLang/,
with form data of name: language and value:en-us. I get 404. What am I
missing?
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+***@googlegroups.com.
To post to this group, send email to django-***@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/d14f8b3a-3bc9-4c2a-bd41-5fdcbcb6bc39%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Shawn H
2014-05-17 14:36:20 UTC
Permalink
Grrrr. I read the docs, and I SWEAR it had the "l" as a capital. It's
always the simplest things. Thank you!
Post by Kelvin Wong
The L in setLang should be setlang as in the L is lowercase
From my Django log "POST /i18n/setlang/ HTTP/1.1" 302 0
K
Post by Shawn H
I'm beginning the process of adding some translations to one public page,
and I can't get my setLang url to match, getting a 404 instead. I've got
USE_I18N = True in my settings. I've got
'django.core.context_processors.i18n', in my TEMPLATE_CONTEXT_PROCESSORS.
Copied the directly from the docs, version 1.6
My urls.py
from django.conf.urls import patterns, include, url
from sdcgis import settings
urlpatterns = patterns('',
#index
url('^sdc/home/',include('sdc_home.urls', namespace='sdc_home')),
#user language
(r'^i18n/', include('django.conf.urls.i18n')),
#I tried url(r'^i18n/', include('django.conf.urls.i18n')), too, with no
luck
...
var data = {'name':'language', 'value':'en-us'};
$.post('/i18n/setLang/', data, function() {
});
My browser says I'm requesting via POST http://localhost/i18n/setLang/,
with form data of name: language and value:en-us. I get 404. What am I
missing?
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+***@googlegroups.com.
To post to this group, send email to django-***@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/60c9a958-558b-4458-911b-38c12d6eb667%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...