'Get canonical project in the case of subproject or translations
:type project: Project
:rtype: Project'

def _get_canonical_project(self, project):

    main_language_project = project.main_language_project
    relation = project.superprojects.first()
    if main_language_project:
        return main_language_project
    elif relation:
        return relation.parent
    return project
