code: def serialize(text: TransText):
      
  
      if isinstance(text, str):
          return {
              'type': 'string',
              'value': text,
          }
      elif isinstance(text, StringToTranslate):
          return {
              'type': 'trans',
              'key': text.key,
              'count': text.count,
              'params': text.params,
          }
      else:
          raise ValueError('Cannot accept type "{}"'
                           .format(text.__class__.__name__))
docs: Takes as input either a string to translate either an actual string and
      transforms it into a JSON-serializable structure that can be reconstructed
      using `unserialize()`.