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?"}})
  ```
docstr: :param languages: A list of languages in ISO code, each corresponding to a different output connection (see [langdetect` documentation](https://github.com/Mimino666/langdetect#languages)). By default, only ["en"] is supported and texts of any other language are routed to "unmatched".
docstr_tok: [":","param","languages",":","A","list","of","languages","in","ISO","code",",","each","corresponding","to","a","different","output","connection","(","see","[","langdetect","`","documentation","]","(","https",":","\/\/github.com\/Mimino666\/langdetect","#","languages",")",")",".","By","default",",","only","[","``","en","''","]","is","supported","and","texts","of","any","other","language","are","routed","to","``","unmatched","''","."]
code: def __init__(self, languages: Optional[List[str]] = None):
      """
      :param languages: A list of languages in ISO code, each corresponding to a different output connection (see [langdetect` documentation](https://github.com/Mimino666/langdetect#languages)). By default, only ["en"] is supported and texts of any other language are routed to "unmatched".
      """
      langdetect_import.check()
      if not languages:
          languages = ["en"]
      self.languages = languages
      component.set_output_types(
          self,
          unmatched=str,
          **{language: str for language in languages},
      )
  
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 1 to create a new TextLanguageRouter object  with example: obj = TextLanguageRouter(languages)