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 %}