Hi all,

I ran my project's tests today using the new beta and was surprised
when one innocuous-looking test failed because the expected English
validation error string didn't match the returned Slovak equivalent.

It turns out that this view is accessible with URL whose path begins
with "/sl/". Ticket #11585 [0] and its associated commit [1] (which
are fairly old) changed
django.utils.translation.get_language_from_request by adding the
get_language_from_path hook. Since my site uses the LocaleMiddleware,
this change activates the Slovak language for the request. Validation
errors and other available translated strings end up being in a
language I don't really want to use.

What are people's thoughts on this? I know the URL is a poor one and
luckily I'm not really affected because humans don't directly access
them, but it seems like a backwards incompatible change that isn't
well documented.

It would be great to be able to pass a keyword argument to
get_language_from_request telling it to not call
get_language_from_path. That way I could override
LocalMiddleware.process_request and fall back to the old language
detection mechanism.

Perhaps there is a simple solution I'm missing.

Best,
Ryan Kaskel

[0] <https://code.djangoproject.com/ticket/11585>
[1] <https://code.djangoproject.com/changeset/16405>

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

Reply via email to