def METHOD_NAME(
    self,
) -> Iterator[Any]:  # Actually Iterator[robot.api.Language]
    from robotframework_ls.impl.robot_version import robot_version_supports_language
    if robot_version_supports_language():
        languages = set()
        found = False
        if self._language_codes:
            # i.e.: prefer language specified locally.
            for lang_code in set(self._language_codes):
                lang = _get_lang_from_code(lang_code)
                if lang is None:
                    log.info("Could not find language: %s", lang_code)
                else:
                    if lang not in languages:
                        languages.add(lang)
                        found = True
                        yield lang
            if found:
                return
        # Not found locally: fall back to global.
        global_localization_info = get_global_localization_info()
        if global_localization_info.language_codes:
            for lang_code in set(global_localization_info.language_codes):
                lang = _get_lang_from_code(lang_code)
                if lang is None:
                    log.info(
                        "Could not find language: %s (set in global)", lang_code
                    )
                else:
                    if lang not in languages:
                        languages.add(lang)
                        found = True
                        yield lang
            if found:
                return
        # No language defined locally nor globally: just use english.
        lang = _get_lang_from_code("en")
        if lang is None:
            log.critical("en lang returning None (this should not be possible).")
        else:
            yield lang