def _translate_page_into(page, language, default=None):
    """
    Return the translation for a given page
    """
    # Optimisation shortcut: No need to dive into translations if page already
    # what we want
    try:
        if page.language == language:
            return page

        if language is not None:
            translations = {t.language: t for t in page.available_translations()}
            if language in translations:
                return translations[language]
    except AttributeError:
        pass

    if hasattr(default, "__call__"):
        return default(page=page)
    return default

    Return the translation for a given page
    
feincms/templatetags/feincms_page_tags.py