<commit_before>from django.utils.translation import activate

from wagtail.wagtailcore.models import Page


def get_translations_for_page(page):
    translations = []
    if page.language != "en":
        activate(page.language)
    try:
        trans_holder = page.get_children().get(title="Translations")
        if page.live:
            translations.append(page.specific)
        translations.extend(trans_holder.get_children().live().specific())
    except Page.DoesNotExist:
        # Check if page exists within the translation folder
        parent = page.get_parent()
        if parent.title == "Translations":
            if parent.get_parent().live:
                translations.append(parent.get_parent().specific)<commit_msg>Activate the language even if english.<commit_after>from django.utils.translation import activate

from wagtail.wagtailcore.models import Page


def get_translations_for_page(page):
    translations = []
    activate(page.language)
    try:
        trans_holder = page.get_children().get(title="Translations")
        if page.live:
            translations.append(page.specific)
        translations.extend(trans_holder.get_children().live().specific())
    except Page.DoesNotExist:
        # Check if page exists within the translation folder
        parent = page.get_parent()
        if parent.title == "Translations":
            if parent.get_parent().live:
                translations.append(parent.get_parent().specific)
{'fraction_non_alphanumeric': 0.10020449897750511, 'fraction_numerical': 0.0, 'mean_word_length': 3.0552486187845305, 'pattern_counts': {'":': 3, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1298708', 'n_tokens_mistral': 400, 'n_tokens_neox': 393, 'n_words': 81}