It has been discussed on this list earlier: automatically calling
set_default_language. However, I feel that all proposed solutions try to
solve two problems: 1) discovering the default language and 2) setting it.
I propose that DM should only be concerned with the second part of the
problem. In that line I propose to add an extremely simple middleware
module to the DM source:
middleware.py:
---
import multilingual
class DefaultLanguageMiddleware(object):
def process_request(self, request):
# Set the default language for model fields
multilingual.set_default_language(request.LANGUAGE_CODE)
---
This middleware works with any language discovery middleware, like
django.middleware.locale.LocaleMiddleware.
As for to getting the language from the URL (a solution to the first
part of the problem), I created a simple app, inspired by posts to this
list, that does just that. I will post another message soliciting comments.
Regards,
Joost
--
Panos Laganakos