Commits

Andreas Madsack committed 40d4a5d Merge

get correct language when switching from one translation to another.

Comments (0)

Files changed (1)

         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 = "/"