Skip to content

Commit e84da7a

Browse files
committed
Google Translate API
1 parent f7450dc commit e84da7a

File tree

1 file changed

+117
-0
lines changed

1 file changed

+117
-0
lines changed

gapi.translate/gapi.translate.d.ts

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+

2+
///<reference path="../gapi/gapi.d.ts" />
3+
4+
/**
5+
*
6+
*/
7+
8+
declare module gapi.client.language {
9+
10+
export interface detections {
11+
12+
/**
13+
* Detect the language of text.
14+
*/
15+
list(object: {
16+
/**
17+
* The text to detect
18+
*/
19+
q: string;
20+
/**
21+
* Selector specifying which fields to include in a partial response.
22+
*/
23+
fields?: string;
24+
}): HttpRequest<GoogleApiTranslateDetectionListResponse>;
25+
}
26+
27+
export interface languages {
28+
29+
30+
/**
31+
* List the source/target languages supported by the API
32+
*/
33+
list(object: {
34+
/**
35+
* the language and collation in which the localized results should be returned
36+
*/
37+
target?: string;
38+
/**
39+
* Selector specifying which fields to include in a partial response.
40+
*/
41+
fields?: string;
42+
}): HttpRequest<GoogleApiTranslateLanguageListResponse>
43+
44+
}
45+
46+
export interface translations {
47+
48+
/**
49+
* Returns text translations from one language to another.
50+
*/
51+
list(object: {
52+
/**
53+
* The text to translate
54+
*/
55+
q: string;
56+
/**
57+
* The target language into which the text should be translated
58+
*/
59+
target: string;
60+
/**
61+
* The customization id for translate
62+
*/
63+
cid?: string;
64+
/**
65+
* This optional parameter allows you to indicate that the text to be translated is either plain-text or HTML. A value of html indicates HTML and a value of text indicates plain-text
66+
*/
67+
format?: string;
68+
/**
69+
* The source language of the text
70+
*/
71+
source?: string;
72+
/**
73+
* Selector specifying which fields to include in a partial response.
74+
*/
75+
fields?: string;
76+
/**
77+
* If prettyprint=true, the results returned by the server will be human readable (pretty printed).
78+
*/
79+
prettyprint?: string;
80+
}): HttpRequest<GoogleApiTranslateTranslationListResponse>;
81+
82+
}
83+
}
84+
85+
86+
interface GoogleApiTranslateTranslationListResponse {
87+
88+
data: {
89+
translations: {
90+
translatedText: string;
91+
detectedSourceLanguage: string;
92+
}[];
93+
}
94+
95+
}
96+
97+
interface GoogleApiTranslateLanguageListResponse {
98+
99+
data: {
100+
languages: {
101+
language: string;
102+
name: string;
103+
}[];
104+
}
105+
106+
}
107+
108+
interface GoogleApiTranslateDetectionListResponse {
109+
110+
data: {
111+
detections: {
112+
language: string;
113+
confidence: number;
114+
}[][];
115+
}
116+
117+
}

0 commit comments

Comments
 (0)