> I'm having fun working with djano-multilingual and especially like the
> idea that if you call set_default_language('fr') that is will make
> {category.name} the same as {catetory.name_fr} in the templates.
>
> However I was wondering if instead of having to call
> set_default_language(), could we look for the language preference in
> the session/cookie (similarly to how i18n works in the django core) or
> is there a design/technical reason why this isn't good.
Mercin (the project lead) mentioned somewhere that he felt there are
situations where you would not want to set_default_language. Still, he
welcomed suggestions for an easy way of doing so automatically.
See:
http://code.google.com/p/django-multilingual/issues/detail?id=20
http://groups.google.com/group/django-multilingual/browse_thread/thread/6801ea196d2aa2a9/1c8c854c474cb420
http://groups.google.com/group/django-multilingual/browse_thread/thread/b05fc30232069e1d/3e2e3ef2830cc36a
http://groups.google.com/group/django-multilingual/browse_thread/thread/551bf9b24c2bd644/4f2f7b9c55ad0b08
Regards,
Joost
By the way, I recently added middelware to DM to automatically set the
default language. Just add
'multilingual.middleware.DefaultLanguageMiddleware' to your
MIDDLEWARE_CLASSES list. If you add it after
'django.middleware.locale.LocaleMiddleware' you get a great i18n system.
Regards,
Joost
--
Joost Cassee
http://joost.cassee.net
--
Panos Laganakos
> On Tue, Jun 10, 2008 at 8:32 PM, Joost Cassee <jo...@cassee.net> wrote:
>
>> By the way, I recently added middelware to DM to automatically set the
>> default language. Just add
>> 'multilingual.middleware.DefaultLanguageMiddleware' to your
>> MIDDLEWARE_CLASSES list. If you add it after
>> 'django.middleware.locale.LocaleMiddleware' you get a great i18n system.
>
> This should probably be added to the wiki for others to take advantage of it.
Good point, added.