Search code examples
pythondjangointernationalizationdjango-localeurl

Django 1.3 get_absolute_url and localeurl


I am using Django 1.3 in my project and switching away from the javascript i18n function to localeurl.

Really handy although I am stuck with my get_absolute_url().

Everytime I try and call up a page it defaults to the default language, even if I have selected another one.

is there a workaround for get_absolute_url() to incorprate the existing language code?


Solution

  • Try whith this:

    from django.utils.translation import get_language
    get_language()