class_docstr: `FeatureConnector` for translations with fixed languages per example.
  
  Input: The Translate feature accepts a dictionary for each example mapping
    string language codes to string translations.
  
  Output: A dictionary mapping string language codes to translations as `Text`
    features.
  
  Example:
  At construction time:
  
  ```
  tfds.features.Translation(languages=['en', 'fr', 'de'])
  ```
  
  During data generation:
  
  ```
  yield {
      'en': 'the cat',
      'fr': 'le chat',
      'de': 'die katze'
  }
  ```
  
  Tensor returned by `.as_dataset()`:
  
  ```
  {
      'en': tf.Tensor(shape=(), dtype=np.str_, numpy='the cat'),
      'fr': tf.Tensor(shape=(), dtype=np.str_, numpy='le chat'),
      'de': tf.Tensor(shape=(), dtype=np.str_, numpy='die katze'),
  }
  ```
docstr: Constructs a Translation FeatureConnector.
  
  Args:
    languages: `list<string>` Full list of languages codes.
    encoder: `tfds.deprecated.text.TextEncoder` or
      list<tfds.deprecated.text.TextEncoder> (optional), an encoder that can
      convert text to integer. One can be shared one per language provided. If
      None, the text will be utf-8 byte-encoded.
    encoder_config: `tfds.deprecated.text.TextEncoderConfig` or
      `list<tfds.deprecated.text.TextEncoderConfig>` (optional), needed if
      restoring from a file with `load_metadata`. One config can be shared or
      one per language can be provided.
    doc: Documentation of this feature (e.g. description).
docstr_tok: ["Constructs","a","Translation","FeatureConnector",".","Args",":","languages",":","`","list","<","string",">","`","Full","list","of","languages","codes",".","encoder",":","`","tfds.deprecated.text.TextEncoder","`","or","list","<","tfds.deprecated.text.TextEncoder",">","(","optional",")",",","an","encoder","that","can","convert","text","to","integer",".","One","can","be","shared","one","per","language","provided",".","If","None",",","the","text","will","be","utf-8","byte-encoded",".","encoder_config",":","`","tfds.deprecated.text.TextEncoderConfig","`","or","`","list","<","tfds.deprecated.text.TextEncoderConfig",">","`","(","optional",")",",","needed","if","restoring","from","a","file","with","`","load_metadata","`",".","One","config","can","be","shared","or","one","per","language","can","be","provided",".","doc",":","Documentation","of","this","feature","(","e.g",".","description",")","."]
code: def __init__(
      self,
      languages,
      encoder=None,
      encoder_config=None,
      *,
      doc: feature_lib.DocArg = None,
  ):
      """Constructs a Translation FeatureConnector.
  
      Args:
        languages: `list<string>` Full list of languages codes.
        encoder: `tfds.deprecated.text.TextEncoder` or
          list<tfds.deprecated.text.TextEncoder> (optional), an encoder that can
          convert text to integer. One can be shared one per language provided. If
          None, the text will be utf-8 byte-encoded.
        encoder_config: `tfds.deprecated.text.TextEncoderConfig` or
          `list<tfds.deprecated.text.TextEncoderConfig>` (optional), needed if
          restoring from a file with `load_metadata`. One config can be shared or
          one per language can be provided.
        doc: Documentation of this feature (e.g. description).
      """
      # If encoder and encoder_config aren't lists, use the same values for all
      # languages.
      self._encoder = encoder
      self._encoder_config = encoder_config
      if not isinstance(encoder, collections_abc.Iterable):
          encoder = [encoder] * len(languages)
      if not isinstance(encoder_config, collections_abc.Iterable):
          encoder_config = [encoder_config] * len(languages)
  
      super(Translation, self).__init__(
          feature_dict={
              lang: text_feature.Text(enc, enc_conf)
              for lang, enc, enc_conf in zip(
                  languages, encoder, encoder_config
              )
          },
          doc=doc,
      )
  
imports: from __future__ import annotations
  import collections.abc
  from typing import Union
  from tensorflow_datasets.core.features import feature
  from tensorflow_datasets.core.features import features_dict
  from tensorflow_datasets.core.features import sequence_feature
  from tensorflow_datasets.core.features import text_feature
  from tensorflow_datasets.core.proto import feature_pb2
  from tensorflow_datasets.core.utils import type_utils
label_desc: Use image node_id 1 to create a new Translation object from inherited base classes: features_dict with example: obj = Translation(languages, encoder, encoder_config)