On Fri, 2007-03-30 at 17:05 +0000, Nuno Mariz wrote:
> Hi Malcolm,
> Simple example:
> 
> In my settings.py:
> gettext = lambda s: s
> LANGUAGES = (
>     ('pt', gettext('Portuguese')),
>     ('en', gettext('English')),
> )
> 
> Imagine a client accessing to my site with a browser using 'pt-br', my
> applications falls in 'pt-br'(because of
> 'django.middleware.locale.LocaleMiddleware'), I think is wrong,
> because in my settings.py I don't have the 'pt-br', only 'pt'.
> When I say "disable the subset language", I mean that if the subset of
> a language is not defined in the settings.py of the project shouldn't
> be loaded.
> Do you agree?

Something strange is going on here. Reading the middleware code and
django/utils/translation/trans_real.py (in particular, get_language()),
it looks like we should be following the rules laid out in i18n.txt.
That is, only LANGUAGES settings are used (so pt-br should not be
possible) and if they submit "pt-br" it will fall back to "pt".

You are seeing different behaviour, I gather?

I'll have to do some tests here to see what's going on. It's possible a
bug has crept in somehow. We should be doing exactly what you expect
(assuming I am understanding you): somebody who submits "pt-br" as their
preference will end up with "pt" as far as your application is
concerned.

Regards,
Malcolm


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to