#lang scribble/manual @(require planet/scribble (for-label racket)) @title{Translate API v2} @margin-note{This documentation has been automatically generated using information supplied by the Google API Discovery service.} Lets you translate text from one language to another @hyperlink["http://code.google.com/apis/language/translate/v2/using_rest.html" "Google documentation."] @table-of-contents{} @defmodule[gapi/macro] @racket[(require-gapi-doc translate.v2.js)] @section{API Parameters} The following optional keyword arguments may be passed to @italic{all} functions for this web service: @defproc[(_ [#:alt alt string? 'N/A] [#:fields fields string? 'N/A] [#:key key string? (api-key)] [#:oauth_token oauth_token string? 'N/A] [#:prettyPrint prettyPrint string? 'N/A] [#:quotaUser quotaUser string? 'N/A] [#:userIp userIp string? 'N/A] ) jsexpr?]{ @margin-note{This is not actually a function. This is just using Scribble's defproc form to list the optional keyword arguments that may be passed to @italic{all} functions for this service.} @racket[alt]: Data format for the response. @racket[fields]: Selector specifying which fields to include in a partial response. @racket[key]: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. @racket[oauth_token]: OAuth 2.0 token for the current user. @racket[prettyPrint]: Returns response with indentations and line breaks. @racket[quotaUser]: Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. @racket[userIp]: IP address of the site where the request originates. Use this if you want to enforce per-user limits. } @section{Resources} @subsection{detections} @defproc[(language-detections-list [#:q q string?] [#:alt alt string? 'N/A] [#:fields fields string? 'N/A] [#:key key string? (api-key)] [#:oauth_token oauth_token string? 'N/A] [#:prettyPrint prettyPrint string? 'N/A] [#:quotaUser quotaUser string? 'N/A] [#:userIp userIp string? 'N/A] ) jsexpr?]{ Detect the language of text. @racket[q]: The text to detect } @subsection{languages} @defproc[(language-languages-list [#:target target string? 'N/A] [#:alt alt string? 'N/A] [#:fields fields string? 'N/A] [#:key key string? (api-key)] [#:oauth_token oauth_token string? 'N/A] [#:prettyPrint prettyPrint string? 'N/A] [#:quotaUser quotaUser string? 'N/A] [#:userIp userIp string? 'N/A] ) jsexpr?]{ List the source/target languages supported by the API @racket[target]: the language and collation in which the localized results should be returned } @subsection{translations} @defproc[(language-translations-list [#:q q string?] [#:target target string?] [#:format format string? 'N/A] [#:source source string? 'N/A] [#:cid cid string? 'N/A] [#:alt alt string? 'N/A] [#:fields fields string? 'N/A] [#:key key string? (api-key)] [#:oauth_token oauth_token string? 'N/A] [#:prettyPrint prettyPrint string? 'N/A] [#:quotaUser quotaUser string? 'N/A] [#:userIp userIp string? 'N/A] ) jsexpr?]{ Returns text translations from one language to another. @racket[q]: The text to translate @racket[target]: The target language into which the text should be translated @racket[format]: The format of the text @racket[source]: The source language of the text @racket[cid]: The customization id for translate }