On Tue, 2008-02-05 at 02:00 -0200, Ramiro Morales wrote:
> Hi guys,
> 
> Didn't dare to post such a big comment to
> http://code.djangoproject.com/ticket/6409 and the advice
> I got on #django was to post it here to get some feedback:
> 
> First, on my http://code.djangoproject.com/ticket/6409#comment:6comment,
> all the semicolons in the UA
> language user preference should be changed to commas.
> 
> This bug seem to have appeared with the security fix that was
> committed on r6608 back in October.

It's a little unclear from your post whether you're reporting another
bug, saying what you think should happen or describing what does happen.
Are you demonstrating actual output or preferred output? Anyway, I think
I understand what you're getting at: get_language_from_request() does
have a small bug and it mostly affects the Chinese at the moment (but
see below).

Anyway, the short version is that (a) yes, there is a bug, (b) no
(because I'm stupid and forgot and the original reporter forgot to file
a ticket), we haven't fixed it yet -- it was actually pointed out very
shortly after the security release and (c) there's actually a bigger bug
that we're going to have to fix.

At the moment, the locale list in Django is a little twisted because we
let in a mix of upper and lower-case locale specifications. We should
*either* use HTTP-format identifiers (using hyphens). I don't understand
your "commas" note above -- basically the HTTP header should satisfy the
spec, which I believe only permits commas ("I believe" means I can't be
bothered to look it up at the moment, but it's certainly very clear
about what is allowed). We should also be using lower-case, which means
es_AR needs to change in a slightly backwards-incompatible fashion.

When that change goes in, the code for getting the language preference
can be simplified dramatically, since the security fix was quite ugly in
order to attempt to preserve backwards-compatibility (and unfortunately,
I chose to test it on es-ar ,rather than zh-cn, so I broken the Chinese
versions).

Thanks for bringing this up again, anyway -- with Trac emails being
broken, I keep missing tickets like this and it's been something we've
been aware of for a while. I'll set aside some time later on this
evening to fix this properly (your patch on that ticket is pretty much
going down the right path). For you personally, it introduces a slight
change for es-ar (from es_AR), which will affect people writing their
own LANGUAGES list, but that's probably a reasonable price to pay for
simplicity and consistency in the code and config files.

Cheers,
Malcolm

-- 
If it walks out of your refrigerator, LET IT GO!! 
http://www.pointy-stick.com/blog/


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to