code: def tranz_context(parser, token):
      
      tokens = token.split_contents()
  
      parameters = {}
      for idx, token in enumerate(tokens[1:], start=1):
          if "=" in token:
              if token[0:token.index('=')] not in ("domain", "prefix", "locale"):
                  raise TemplateSyntaxError(
                      "Unexpected token {0} in tag {{tag_name}}".format(token)
                  )
  
              k, v = token[0:token.index('=')], token[token.index('=') + 1:]
              parameters[k] = v
          else:
              raise TemplateSyntaxError(
                  "Unexpected token {0} in tag {{tag_name}}".format(token))
  
      return TranzContextNode(
          parameters.get('prefix', None),
          parameters.get('domain', None),
          parameters.get('locale', None)
      )
docs: Templatetagish wrapper for Translator.transchoice()