Skip to content

Translate tags

hypha.apply.funds.templatetags.translate_tags

register module-attribute

register = Library()

can_translate_submission

can_translate_submission(user)

Verify that system settings & user role allows for submission translations.

Parameters:

  • user –

    the user to check the role of.

Returns:

  • bool ( bool ) –

    true if submission can be translated, false if not.

Source code in hypha/apply/funds/templatetags/translate_tags.py
@register.filter
def can_translate_submission(user) -> bool:
    """Verify that system settings & user role allows for submission translations.

    Args:
        user: the user to check the role of.

    Returns:
        bool: true if submission can be translated, false if not.

    """
    return bool(settings.APPLICATION_TRANSLATIONS_ENABLED and user.is_org_faculty)