def METHOD_NAME(self, value: object):
    if isinstance(value, str):
        value = [value]
    if not isinstance(value, list):
        raise c.ValidationError('Expected a list of language codes.')
    for lang in value[:]:
        if lang != 'en':
            lang_detected = self.get_lunr_supported_lang(lang)
            if not lang_detected:
                log.info(f"Option search.lang '{lang}' is not supported, falling back to 'en'")
                value.remove(lang)
                if 'en' not in value:
                    value.append('en')
            elif lang_detected != lang:
                value.remove(lang)
                value.append(lang_detected)
                log.info(f"Option search.lang '{lang}' switched to '{lang_detected}'")
    return value