#13973: Get current language name filter in templates
-----------------------------------------------+----------------------------
Reporter: Secator <[email protected]> | Owner: nobody
Status: new | Milestone: 1.3
Component: Translations | Version: 1.2
Keywords: language name | Stage: Unreviewed
Has_patch: 0 |
-----------------------------------------------+----------------------------
Currently there's no way to retrieve current language name easily in
templates. You can only use {% get_current_language ... %} filter to get
the language code (eg. 'en-us' or 'de-de').
There should be a template filter in django.templatetags.i18n to get the
"English" or "German" strings (verbose name of the language).
Example:
{{{
#settings.py:
LANGUAGES = (
('de', 'German'),
('en', 'English'),
)
#templates:
{% get_current_language as LANGUAGE_CODE %} # Existing filter. Returns en-
us if language is english.
{% get_current_language_name as LANGUAGE_NAME %} # Proposed filter. Should
return 'English' if LANGUAGE_CODE is 'en'. Basically should return the
second element of settings.LANGUAGES touples.
}}}
--
Ticket URL: <http://code.djangoproject.com/ticket/13973>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.