def _validate_language_code(language_codes: str | list[str]) -> list[str]:
        """Validate and normalize provided language codes.

        Args:
            language_codes: The language code(s), either as a string (single or comma-separated) or a list.

        Raises:
            ValidationError: If any of the languages are not supported by EasyOCR

        Returns:
            A list with the normalized language codes.
        """
        if isinstance(language_codes, str):
            # Handle comma-separated language codes
            languages = [lang.strip().lower() for lang in language_codes.split(",")]
        else:
            # Handle list of language codes
            languages = [lang.lower() for lang in language_codes]

        unsupported_langs = [lang for lang in languages if lang not in EASYOCR_SUPPORTED_LANGUAGE_CODES]
        if unsupported_langs:
            raise ValidationError(
                "The provided language codes are not supported by EasyOCR",
                context={
                    "language_code": ",".join(unsupported_langs),
                    "supported_languages": ",".join(sorted(EASYOCR_SUPPORTED_LANGUAGE_CODES)),
                },
            )

        return languages
Validate and normalize provided language codes.

        Args:
            language_codes: The language code(s), either as a string (single or comma-separated) or a list.

        Raises:
            ValidationError: If any of the languages are not supported by EasyOCR

        Returns:
            A list with the normalized language codes.
        
kreuzberg/_ocr/_easyocr.py