History¶
Changelog¶
Tip: (unreleased)
- Release 2.0.2: (2015-01-26)
- (Re-)Add import of models in middleware, to ensure monkeypatch of
reverse
happens soon enough. Fixes #5, again. - Fix detection of locales with >2 letter codes. Fixes #38.
- (Re-)Add import of models in middleware, to ensure monkeypatch of
- Release 2.0.1: (2013-09-19)
- Change canonical documentation links from http://pythonhosted.org/django-localeurl/ to http://django-localeurl.readthedocs.org
- Release 2.0: (2013-09-19)
- BACKWARDS-INCOMPATIBLE: Drop support for Django 1.0 - 1.2; Python 2.4 and 2.5.
- Deprecate
localeurl_future
tag library, always use new url tag syntax. - Try importing
patterns, url
first fromdjango.conf.urls
; usedjango.conf.urls.defaults
only as Django 1.3 fallback. Fixes #36. - Don’t try to parse referrer if not present. Fixes #33. Thanks Simon Luijk.
- Add support for a session-stored locale fallback. Thanks Sylvain Fourmanoit for report and draft patch, and Alex Marandon for adding tests. Fixes #23.
- Make language-code matching case-insensitive, per RFC. Thanks torgeilo for the report. Fixes #32.
- Fix issue with non-ASCII characters in URLs. Thanks Chris Adams.
- Release 1.5: (2011-08-24)
- Added
LOCALE_REDIRECT_PERMANENT
setting; defaults to True, if set toFalse
302 redirects are used rather than 301. Thanks oyvindeh. LOCALE_INDEPENDENT_PATHS
can now be plain string regular expressions, they don’t have to be compiled regex objects. Fixes #9.- Added import of
localeurl.models
tolocaleurl.middleware
, to ensure thatreverse
is monkeypatched before any requests are served. Fixes #5. Thanks Antti Kaihola for the report, Andrey Shipilov and jefurii for fix confirmation. - Added iri_to_uri encoding of non-ASCII redirect URLs. Fixes #13.
- Sorted language codes longest-first to avoid matching e.g. ‘pt’ before ‘pt-br’. Fixes #15. Thanks Roman Barczyński for report and draft patch.
- Added
LOCALE_INDEPENDENT_STATIC_URL
setting to mirrorLOCALE_INDEPENDENT_MEDIA_URL
. This setting defaults to True, so if you want URLs under STATIC_URL to be locale-dependent, you will need to set it to False. - Fixed middleware redirection when there is a script prefix. Fixes #10. Thanks iro for report and draft patch.
- Added
localeurl_future
template tag library to providelocale_url
tag that wraps the new Djangourl
tag to allow using the new syntax and avoid deprecation warnings under Django 1.3. Fixes #17. Thanks Fabian Büchler for the report. - Accounted for reverse() receiving kwargs=None. Fixes #18. Thanks Alexander Clausen for report and tests, Joel Ryan for draft patch.
- Prevented change_locale view from stripping query params from
next
. Fixes #7. Thanks Sverre Johansen.
- Added
- Release 1.4: (2010-03-19)
- Moved localeurl settings from localeurl/__init__.py to localeurl/settings.py.
- Added
LocaleurlSitemap
for easier creation of multilingual sitemaps. - Added
LOCALEURL_USE_ACCEPT_LANGUAGE
setting to check HTTP Accept-Language header before resorting tosettings.LANGUAGE_CODE
when locale is not specified in URL. - Switched to 301 permanent redirects for no-locale URL redirect.
- Moved to BitBucket for source code hosting.
- Added the
change_locale
view, contributed by Panos Laganakos.
- Release 1.3: (2009-04-06)
- Changed chlocale tag to strip prefix of locale-independent paths.
- Moved the monkey-patching of urlresolvers.reverse to models.py.
- Removed
REDIRECT_LOCALE_INDEPENDENT_PATHS
settings option; this is now the default.
- Release 1.2: (2009-01-19):
- Moved the documentation into the source tree. (Based on a blog post by Andi Albrecht.)
- Released version 1.2.
- Release 1.1: (2008-11-20):
- Added the
PREFIX_DEFAULT_LOCALE
settings option contributed by Jonas Christian. - Added
REDIRECT_LOCALE_INDEPENDENT_PATHS
settings option.
- Added the
- Release 1.0: (2008-09-10):
- Added Django 1.0 or higher as a prerequisite.
- Moved to Google Code.
Credits¶
localeurl was developed by Joost Cassee based on the work by Atli Þorbjörnsson. Contributions by Jonas Christian. Includes code from the django-localize project by Artiom Diomin. Currently maintained by Carl Meyer.
It was partly taken from and partly inspired by discussions on the django-users and django-multilingual mailinglists:
- Atli Þorbjörnsson: Locale from URL Middleware
- Panos Laganakos: creating a multilingual middleware
- Piotr Majewski: multilingual middleware NEW FEATURE!
See also this blog post on internationalisation by Yann Malet that references Atli’s code.
- The announcement of localeurl on these lists can be found here: