I think I got it! Wrong ordering of middleware - I had the i18n-urls middleware before some other stuff, which screwed up a lot... It's working now, and my hair will probably grow back eventually...
//emil On Jan 11, 12:41 pm, Emil <[EMAIL PROTECTED]> wrote: > Nope, that doesn't seem to be it - same problem with dummy caching on > dev server. More likely the culprit is the Advanced Locale From URL > Middleware I'm using[1]. I inspected the response headers I get, and > even if the language is set to English on the site, response headers > always show Content-Language as "sv-se"... Weird thing there is that > the LANGUAGE_CODE apparently still is correct, because the english > fields are fetched from the db. I'm using a somewhat crude method for > getting the correct language content from the db, a switch/case > template tag (from Jacob Kaplan-Moss, fetched from djangosnippets.org) > operating on LANGUAGE_CODE and then pulling the correct field from the > model. > > Gaaah. I'm really lost here. Any help would be greatly appreciated. I > can't seem to find a pattern either in what gets translated correctly > and when, because it seems to change - also, now, while writing this, > I noticed that the LANGUAGE_CODE doesn't seem to be correct all the > time either, but only on some pages... I can't seem to find a pattern > for when and why this happens. > > [1] Link found on the ContributedMiddleware-wiki > page:http://www.jondesign.net/articles/2006/jul/02/langue-depuis-url-djang... > > //emil > > On Jan 11, 11:55 am, Emil <[EMAIL PROTECTED]> wrote: > > > Hi Peter, > > > thanks for the tip, I'm reading up on the vary_on_headers-decorator > > right now, I'm gonna see if that clears things up. Just seems weird > > from my reasoning, and another project I'm working on doesn't have > > this problem, with nearly excactly the same setup. Oh well, I'll poke > > around and see what I find. > > > Thanks. > > > //emil > > > On Jan 11, 3:17 am, Peter Rowell <[EMAIL PROTECTED]> wrote: > > > > Emil: > > > > > Except that on a couple of pages, > > > > the language seems to get stuck on the translated language after the > > > > first time I change languages. > > > > This smells very much like a caching issue. Do you have any form of > > > caching enabled? If so, turn it off and see if the problem is > > > magically fixed. > > > > You may need to cache at below-the-page level (ie. component level - > > > see the cache templatetag) or you may need to add one or more vary-on > > > variables so that you get different cache values for different > > > languages (or whatever). --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---