blob: 8ae36160ee293533be78d232b80c25c76e095324 [file] [log] [blame]
John Asmuth614db982014-04-24 15:46:26 -04001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -040075<h1><a href="translate_v2.html">Google Cloud Translation API</a> . <a href="translate_v2.translations.html">translations</a></h1>
John Asmuth614db982014-04-24 15:46:26 -040076<h2>Instance Methods</h2>
77<p class="toc_element">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070078 <code><a href="#close">close()</a></code></p>
79<p class="firstline">Close httplib2 connections.</p>
80<p class="toc_element">
Yoshi Automation Botb6971b02020-11-26 17:16:03 -080081 <code><a href="#list">list(q, target, source=None, cid=None, format=None, model=None, x__xgafv=None)</a></code></p>
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -040082<p class="firstline">Translates input text, returning translated text.</p>
83<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070084 <code><a href="#translate">translate(body=None, x__xgafv=None)</a></code></p>
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -040085<p class="firstline">Translates input text, returning translated text.</p>
John Asmuth614db982014-04-24 15:46:26 -040086<h3>Method Details</h3>
87<div class="method">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070088 <code class="details" id="close">close()</code>
89 <pre>Close httplib2 connections.</pre>
90</div>
91
92<div class="method">
Yoshi Automation Botb6971b02020-11-26 17:16:03 -080093 <code class="details" id="list">list(q, target, source=None, cid=None, format=None, model=None, x__xgafv=None)</code>
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -040094 <pre>Translates input text, returning translated text.
John Asmuth614db982014-04-24 15:46:26 -040095
96Args:
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -040097 q: string, The input text to translate. Repeat this parameter to perform translation
98operations on multiple text inputs. (required) (repeated)
99 target: string, The language to use for translation of the input text, set to one of the
100language codes listed in Language Support. (required)
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800101 source: string, The language of the source text, set to one of the language codes listed in
102Language Support. If the source language is not specified, the API will
103attempt to identify the source language automatically and return it within
104the response.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800105 cid: string, The customization id for translate (repeated)
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800106 format: string, The format of the source text, in either HTML (default) or plain-text. A
107value of &quot;html&quot; indicates HTML and a value of &quot;text&quot; indicates plain-text.
108 Allowed values
109 html - Specifies the input is in HTML
110 text - Specifies the input is in plain textual format
111 model: string, The `model` type requested for this translation. Valid values are
112listed in public documentation.
Bu Sun Kim65020912020-05-20 12:08:20 -0700113 x__xgafv: string, V1 error format.
114 Allowed values
115 1 - v1 error format
116 2 - v2 error format
John Asmuth614db982014-04-24 15:46:26 -0400117
118Returns:
119 An object of the form:
120
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400121 { # The main language translation response message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700122 &quot;translations&quot;: [ # Translations contains list of translation results of given text
John Asmuth614db982014-04-24 15:46:26 -0400123 {
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800124 &quot;translatedText&quot;: &quot;A String&quot;, # Text translated into the target language.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800125 &quot;detectedSourceLanguage&quot;: &quot;A String&quot;, # The source language of the initial request, detected automatically, if
126 # no source language was passed within the initial request. If the
127 # source language was passed, auto-detection of the language will not
128 # occur and this field will be empty.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800129 &quot;model&quot;: &quot;A String&quot;, # The `model` type used for this translation. Valid values are
130 # listed in public documentation. Can be different from requested `model`.
131 # Present only if specific model type was explicitly requested.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400132 },
133 ],
134 }</pre>
135</div>
136
137<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700138 <code class="details" id="translate">translate(body=None, x__xgafv=None)</code>
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400139 <pre>Translates input text, returning translated text.
140
141Args:
Dan O'Mearadd494642020-05-01 07:42:23 -0700142 body: object, The request body.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400143 The object takes the form of:
144
145{ # The main translation request message for the Cloud Translation API.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800146 &quot;source&quot;: &quot;A String&quot;, # The language of the source text, set to one of the language codes listed in
147 # Language Support. If the source language is not specified, the API will
148 # attempt to identify the source language automatically and return it within
149 # the response.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800150 &quot;format&quot;: &quot;A String&quot;, # The format of the source text, in either HTML (default) or plain-text. A
151 # value of &quot;html&quot; indicates HTML and a value of &quot;text&quot; indicates plain-text.
152 &quot;q&quot;: [ # The input text to translate. Repeat this parameter to perform translation
153 # operations on multiple text inputs.
154 &quot;A String&quot;,
155 ],
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700156 &quot;model&quot;: &quot;A String&quot;, # The `model` type requested for this translation. Valid values are
157 # listed in public documentation.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800158 &quot;target&quot;: &quot;A String&quot;, # The language to use for translation of the input text, set to one of the
159 # language codes listed in Language Support.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400160 }
161
162 x__xgafv: string, V1 error format.
163 Allowed values
164 1 - v1 error format
165 2 - v2 error format
166
167Returns:
168 An object of the form:
169
170 { # The main language translation response message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700171 &quot;translations&quot;: [ # Translations contains list of translation results of given text
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400172 {
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800173 &quot;translatedText&quot;: &quot;A String&quot;, # Text translated into the target language.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800174 &quot;detectedSourceLanguage&quot;: &quot;A String&quot;, # The source language of the initial request, detected automatically, if
175 # no source language was passed within the initial request. If the
176 # source language was passed, auto-detection of the language will not
177 # occur and this field will be empty.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800178 &quot;model&quot;: &quot;A String&quot;, # The `model` type used for this translation. Valid values are
179 # listed in public documentation. Can be different from requested `model`.
180 # Present only if specific model type was explicitly requested.
John Asmuth614db982014-04-24 15:46:26 -0400181 },
182 ],
183 }</pre>
184</div>
185
186</body></html>