def METHOD_NAME(corpus: "Corpus") -> Optional[str]:
    """
    Detect the language in the corpus
    Parameters
    ----------
    corpus
        Corpus to detect the language
    Returns
    -------
    Detected language ISO code or None if language not detected
    """
    texts = corpus.documents[:MAX_DOCS]
    texts = [" ".join(t.replace("\n", " ").split(" ")[:MAX_WORDS]) for t in texts]
    languages = list()
    for text in texts:
        try:
            languages.append(detect(text))
        except LangDetectException:
            languages.append(None)
    # filter out languages not in supported by Orange
    candidates = [l for l, _ in Counter(languages).most_common() if l in ISO2LANG]
    return candidates[0] if candidates else None