Strange django-localeurl redirect for firefox on ubuntu

39 views
Skip to first unread message

Iqbal Abdullah

unread,
Dec 28, 2010, 9:39:50 PM12/28/10
to django-multilingual
Hi,

This issue might only be true for my environment, but I'm seeing
strange locale redirects when using django-localeurl

My setup:
Browser is Firefox 3.6.13 for Ubuntu (Ubuntu 10.04)
django-localeurl 1.4
django 1.2.1

settings.py:

...
...
TIME_ZONE = 'UTC'
LANGUAGE_CODE = 'ja'

ugettext = lambda s: s
LANGUAGES = (
('ja', ugettext('日本語')),
('en', ugettext('英語')),
)

MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',

'localeurl.middleware.LocaleURLMiddleware',
)

INSTALLED_APPS = (
'localeurl',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
)

Now, when I access the site without a language prefix, i.e http://www.test.com/
from Chrome browser on Ubuntu or IE and Firefox on Windows XP, I
correctly get directed to http://www.test.com/ja/. Accessing
http://www.test.com/en/ also works and doesn't get directed elsewhere.
Accessing a totally different locale, like http://www.test.com/ko/
also correctly directs me to http://www.test.com/ja/ko/

But if I try the same thin on with Firefox 3.6.13 on Ubuntu, I will
get en as my default, i.e http://www.test.com/ will bring me to
http://www.test.com/en/. Trying to access http://www.test.com/ja/
directly will also bring me to http://www.test.com/en/
On the other hand, if I try to access http://www.ezsms.biz/ko/, I get
redirected to http://www.ezsms.biz/ja/ko (correct)

I've checked the accepted language settings on my Firefox and it looks
ok.
ja, en-gb, en-us, en (in that order)

Have anyone seen this before? Is there any specific data which I can
check to see what is actually going on?

Iqbal Abdullah

unread,
Dec 28, 2010, 9:59:53 PM12/28/10
to django-multilingual
I've figured out what's wrong!

As expected, it was the Firefox browser.
I looked at the webserver logs and it turned out that accessing
http://www.test.com/ somehow was a direct access to /en/ on the
server; There was no redirect log from / to /en/ so I confirmed that
the framework was OK.

I then deleted all history on Firefox and it worked as expected.
Sorry for the false alarm.
> Now, when I access the site without a language prefix, i.ehttp://www.test.com/
> from Chrome browser on Ubuntu or IE and Firefox on Windows XP, I
> correctly get directed tohttp://www.test.com/ja/. Accessinghttp://www.test.com/en/also works and doesn't get directed elsewhere.
> Accessing a totally different locale, likehttp://www.test.com/ko/
> also correctly directs me tohttp://www.test.com/ja/ko/
>
> But if I try the same thin on with Firefox 3.6.13 on Ubuntu, I will
> get en as my default, i.ehttp://www.test.com/will bring me tohttp://www.test.com/en/. Trying to accesshttp://www.test.com/ja/
> directly will also bring me tohttp://www.test.com/en/
Reply all
Reply to author
Forward
0 new messages