Check if LANGUAGE_CODE in request is set if no prefix is provided

Issue #1 resolved
Lars Francke
created an issue

Thank you for taking over this project!

If the //LocaleMiddleware// is used it inspects the HTTP headers and looks for //HTTP_ACCEPT_LANGUAGE// and sets //LANGUAGE_CODE// in the request accordingly. I think we should use this as an additional hint for the language if no prefix is provided.

This is the same as Issue 27 from Google Code [1].


Comments (3)

  1. Carl Meyer repo owner
    • changed status to open

    I agree that checking the Accept-Language header as a fallback makes sense; I'll add that. From reading issue 27 on Google Code, some people want it to also check the session var or cookie that Django sets; if you're using LocaleUrlMiddleware there's no reason to be storing language info in session/cookie, so I don't see any reason to add that. Also someone requested checking the country TLD; IMO that's out of scope for localeurl.

    The attached patch doesn't make sense: Why would checking Accept-Language be related to whether there is a QUERY_STRING? The actual patch will need be slightly more invasive than that, I think.

  2. Log in to comment