On Thu, 2009-08-13 at 10:11 +0200, Jarek Zgoda wrote:
> Wiadomość napisana w dniu 2009-08-13, o godz. 09:38, przez Enrico  
> Sartorello:
> 
> > Nice information, so we can go ahead working with activate() :-)
> >
> > Let me ask you one more question: in your code, i see you're using  
> > django.util.translation.get_language(), it's not a documented  
> > function and according to django policies it can be changed or  
> > removed in any new release.
> > Perhaps it's better using request.LANGUAGE_CODE?
> 
> 
> This function looks like part of public interface and the page 
> http://docs.djangoproject.com/en/dev/misc/api-stability/ 
>   lists the whole internationalization subsystem as stable API so I'd  
> not worry.

Well, it says that anything documented in the internationalization
subsystem is stable API. So the original poster still has a point.

But let's not worry about semantics too much here. I am quite willing to
say that get_language() is stable API (I'm kind of the de-factor i18n
sub-system maintainer, so I doubt I'll get any real arguments there). It
hasn't changed in years and it does what is advertised. It's also
needed, for exactly the reasons Jarek points out. Let's just document it
and help people out.

Generally, we haven't documented a lot of the internals of the i18n
stuff for low-level customisation. Ramiro Morales has been doing some
good work over the past few months helping sort out the documentation
there -- splitting up some confusing single file i18n stuff into i18n
and l10n and template versus backend. We're now in a position to start
filling in some of the gaps.

In short: feel free to use get_language() and unless some amazingly
hidden bug or security hole is found in it, the API will not change. I'm
happy to take a documentation patch that documents what it does (Jarek's
code example is a good place to start -- that's the sort of thing I
would include in the docs).

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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to