class_docstr: Routes a text input onto one of different output connections depending on its language.
  This is useful for routing queries to different models in a pipeline depending on their language.
  The set of supported languages can be specified.
  For routing Documents based on their language use the related DocumentLanguageClassifier component to first
  classify the documents and then the MetaDataRouter to route them.
  
  Example usage in a retrieval pipeline that passes only English language queries to the retriever:
  
  ```python
  document_store = InMemoryDocumentStore()
  p = Pipeline()
  p.add_component(instance=TextLanguageRouter(), name="text_language_router")
  p.add_component(instance=InMemoryBM25Retriever(document_store=document_store), name="retriever")
  p.connect("text_language_router.en", "retriever.query")
  p.run({"text_language_router": {"text": "What's your query?"}})
  ```
code: def detect_language(self, text: str) -> Optional[str]:
      try:
          language = langdetect.detect(text)
      except langdetect.LangDetectException:
          logger.warning(
              "Langdetect cannot detect the language of text: %s", text
          )
          language = None
      return language
  
imports: import logging
  from typing import List, Dict, Optional
  from haystack import component
  from haystack.lazy_imports import LazyImport
label_desc: Use image node_id 3 for calling the TextLanguageRouter obj's underlying member method code with example usage: obj.detect_language(text) and returns: language