URL template tag without locale in Django 1.4 -


i added locale specific url-s django app i18n_patterns , it’s working nicely, in cases need have url pointing view without locale information.

my current setup works english pages don’t have locale in path, e.g: www.foobar.com, other www.foobar.com/et/ etc. works nicely. now, every user has "public profile" page in www.foobar.com/u/123 etc.

if {% url user_profile_page %} in template, locale in url, i’d show non-locale version, because want public profiles have non-locale url (and fact if using different language , redirects locale based url, fine).

there’s nothing django documentation suggest {% url %} template tag able this, there something?

in template code should able use {% language %} tag in following manner specify language url reversing:

{% language en %} <a href="{% url user_profile_page %}">user 1</a> {% endlanguage %} 

specifying english language code in case should result in url without prefix.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -