python - django : get the current locale inside a templatetag -


i've internationalized django (1.4) app.

in app, have templatetag needs know current language.

i think use django.utils.translation.get_language seems inside templatetag, returns default language , not current language.

i fixed reading request.language_code context.

but know if there better way language in templatetag

there's few default templatetags can use

{% get_current_language %} 

or

{% get_current_language foo %} 

e.g.

{% render_bar request foo %} 

Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -