Commits

Andreas Madsack  committed 984724b

get correct language when switching from one translation to another.

  • Participants
  • Parent commits 04b79d5

Comments (0)

Files changed (1)

File lfc/views.py

         else:
             canonical = obj.get_canonical(request)
             if canonical:
-                url = canonical.get_absolute_url()
+                translated = canonical.get_translation(request, language)
+                if translated:
+                    url = translated.get_absolute_url()
+                else:
+                    url = canonical.get_absolute_url()
             else:
                 if language == settings.LANGUAGE_CODE:
                     url = "/"