# Google Cloud Translation API . detections

## Instance Methods

Detects the language of text within a request.

Detects the language of text within a request.

### Method Details

`detect(body=None, x__xgafv=None)`

    Detects the language of text within a request.

    Args:
      body: object, The request body.
        The object takes the form of:

    { # The request message for language detection.
        "q": [ # The input text upon which to perform language detection. Repeat this
            # parameter to perform language detection on multiple text inputs.
          "A String",
        ],
      }

      x__xgafv: string, V1 error format.
        Allowed values
          1 - v1 error format
          2 - v2 error format

    Returns:
      An object of the form:

        {
        "detections": [ # A detections contains detection results of several text
          [ # An array of languages which we detect for the given text The most likely language list first.
            {
              "isReliable": True or False, # A boolean to indicate is the language detection result reliable.
              "language": "A String", # The language we detected.
              "confidence": 3.14, # The confidence of the detection result of this language.
            },
          ],
        ],
      }

`list(q, x__xgafv=None)`

    Detects the language of text within a request.

    Args:
      q: string, The input text upon which to perform language detection. Repeat this
    parameter to perform language detection on multiple text inputs. (required) (repeated)
      x__xgafv: string, V1 error format.
        Allowed values
          1 - v1 error format
          2 - v2 error format

    Returns:
      An object of the form:

        {
        "detections": [ # A detections contains detection results of several text
          [ # An array of languages which we detect for the given text The most likely language list first.
            {
              "isReliable": True or False, # A boolean to indicate is the language detection result reliable.
              "language": "A String", # The language we detected.
              "confidence": 3.14, # The confidence of the detection result of this language.
            },
          ],
        ],
      }