Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/django/middleware/locale.py
Commit message (Collapse)AuthorAgeFilesLines
* Fixed #19910 -- Added slash to i18n redirect if ↵Bas Peschier2015-03-261-5/+8
| | | | | | | | APPEND_SLASH is set. This introduces a force_append_slash argument for request.get_full_path() which is used by RedirectFallbackMiddleware and CommonMiddleware when handling redirects for settings.APPEND_SLASH.
* Fixed #23960 -- Removed http.fix_location_headerClaude Paroz2015-03-181-10/+6
| | | | Thanks Carl Meyer for the report and Tim Graham for the review.
* Fixed #24360 -- Delayed internal LocaleMiddleware ↵Claude Paroz2015-03-021-12/+9
| | | | | | variable initialization Failing in a middleware `__init__` is preventing proper debug view.
* Sorted imports with isort; refs #23860.Tim Graham2015-02-061-3/+4
|
* Fixed #21579 -- Made LocaleMiddleware respect script prefix.Tim Graham2014-08-141-4/+13
| | | | Thanks buettgenbach at datacollect.com for the report and patch.
* Fixed #21389 -- Accept most valid language codesBouke Haarsma2014-02-261-6/+1
| | | | | | | | | | | | By removing the 'supported' keyword from the detection methods and only relying on a cached settings.LANGUAGES, the speed of said methods has been improved; around 4x raw performance. This allows us to stop checking Python's incomplete list of locales, and rely on a less restrictive regular expression for accepting certain locales. HTTP Accept-Language is defined as being case-insensitive, based on this fact extra performance improvements have been made; it wouldn't make sense to check for case differences.
* Fixed #21473 -- Limited language preservation to logoutLudwik Trammer2013-12-121-10/+0
| | | | | | | | | Current language is no longer saved to session by LocaleMiddleware on every response (the behavior introduced in #14825). Instead language stored in session is reintroduced into new session after logout. Forward port of c558a43fd6 to master.
* Fixed #5789 -- Changed LocaleMiddleware session variable ↵Bouke Haarsma2013-10-221-2/+8
| | | | | | | | | | to '_language'. The old 'django_language' variable will still be read from in order to migrate users. The backwards-compatability shim will be removed in Django 1.8. Thanks to jdunck for the report and stugots for the initial patch.
* Fixed #21288 -- Fixed E126 pep8 warningsAlasdair Nicol2013-10-211-1/+1
|
* Fixed #7603 -- Added a 'scheme' property to the ↵Unai Zalakain2013-10-151-2/+2
| | | | | | | | | | | | | | | | | | | HttpRequest object `HttpRequest.scheme` is `https` if `settings.SECURE_PROXY_SSL_HEADER` is appropriately set and falls back to `HttpRequest._get_scheme()` (a hook for subclasses to implement) otherwise. `WSGIRequest._get_scheme()` makes use of the `wsgi.url_scheme` WSGI environ variable to determine the request scheme. `HttpRequest.is_secure()` simply checks if `HttpRequest.scheme` is `https`. This provides a way to check the current scheme in templates, for example. It also allows us to deal with other schemes. Thanks nslater for the suggestion.
* Fixed #19277 -- Added ↵Emil Stenström2013-10-031-1/+2
| | | | | | LocaleMiddleware.response_redirect_class Thanks ppetrid at yawd.eu for the suggestion.
* Deprecated SortedDict (replaced with ↵Curtis Maloney2013-08-041-2/+3
| | | | | | collections.OrderedDict) Thanks Loic Bistuer for the review.
* Replaced `and...or...` constructs with PEP 308 ↵Ramiro Morales2013-05-271-1/+1
| | | | conditional expressions.
* Fixed #14825 -- LocaleMiddleware keeps languageVlastimil Zíma2013-05-251-0/+4
| | | | * LocaleMiddleware stores language into session if it is not present there.
* Fixed #11915: generic Accept-Language matches ↵Łukasz Langa2013-05-191-1/+2
| | | | country-specific variants
* Fixed #5241 -- Kept active transalation in ↵Aymeric Augustin2013-02-281-1/+1
| | | | LocaleMiddleware.process_response.
* Fixes #17866: Vary: Accept-Language header when language ↵Łukasz Langa2013-02-231-9/+17
| | | | prefix used
* Fixed #19488 -- Made i18n_patterns redirect work with ↵Claude Paroz2013-01-111-3/+5
| | | | | | non-slash-ending paths Thanks Daniel Gerzo for the report and the initial patch.
* Fixed #17817 -- Modified LocalMiddleware to use full ↵Jannis Leidel2012-03-021-2/+5
| | | | | | URLs when redirecting to i18n URLs. Thanks to Paul for keeping an eye on the standards. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17633 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #17734 -- Made sure to only redirect translated ↵Jannis Leidel2012-03-021-5/+12
| | | | | | URLs if they can actually be resolved to prevent unwanted redirects. Many thanks to Orne Brocaar and Anssi Kääriäinen for input. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17621 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #17720 -- Stopped the LocaleMiddleware from ↵Jannis Leidel2012-02-181-1/+3
| | | | | | overeagerly using the request path for language activation if it's actually not wanted. Thanks to Anssi Kääriäinen for the initial patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17547 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #11585 -- Added ability to translate and prefix ↵Jannis Leidel2011-06-151-3/+23
| | | | | | URL patterns with a language code as an alternative method for language discovery. Many thanks to Orne Brocaar for his initial work and Carl Meyer for feedback. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16405 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #8121 -- Don't override the Content-Language HTTP ↵Malcolm Tredinnick2008-08-091-1/+2
| | | | | | | | | header in the locale middleware if it's already been set. Thanks, jcassee. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8259 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #2109 -- Convert old-style classes to new-style ↵Adrian Holovaty2006-06-081-1/+1
| | | | | | classes throughout Django. Thanks, Nicola Larosa git-svn-id: http://code.djangoproject.com/svn/django/trunk@3113 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #1707 -- LocaleMiddleware now sets ↵Adrian Holovaty2006-05-051-1/+1
| | | | | | Content-Language header. Thanks, ubernostrum git-svn-id: http://code.djangoproject.com/svn/django/trunk@2843 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Merged i18n branch into the trunk! Fixes #65, and ↵Jacob Kaplan-Moss2005-11-041-0/+24
perhaps some others. NB: this means that the i18n branch is now obsolete and will be made read-only. git-svn-id: http://code.djangoproject.com/svn/django/trunk@1068 bcc190cf-cafb-0310-a4f2-bffc1f526a37