|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric7.Plugins.UiExtensionPlugins.Translator.TranslatorEngines.GoogleV2Engine</title> |
|
4 <meta charset="UTF-8"> |
|
5 <link rel="stylesheet" href="styles.css"> |
|
6 </head> |
|
7 <body> |
|
8 <a NAME="top" ID="top"></a> |
|
9 <h1>eric7.Plugins.UiExtensionPlugins.Translator.TranslatorEngines.GoogleV2Engine</h1> |
|
10 |
|
11 <p> |
|
12 Module implementing the Google V2 translation engine. |
|
13 </p> |
|
14 <h3>Global Attributes</h3> |
|
15 |
|
16 <table> |
|
17 <tr><td>None</td></tr> |
|
18 </table> |
|
19 <h3>Classes</h3> |
|
20 |
|
21 <table> |
|
22 |
|
23 <tr> |
|
24 <td><a href="#GoogleV2Engine">GoogleV2Engine</a></td> |
|
25 <td>Class implementing the translation engine for the new Google translation service.</td> |
|
26 </tr> |
|
27 </table> |
|
28 <h3>Functions</h3> |
|
29 |
|
30 <table> |
|
31 <tr><td>None</td></tr> |
|
32 </table> |
|
33 <hr /> |
|
34 <hr /> |
|
35 <a NAME="GoogleV2Engine" ID="GoogleV2Engine"></a> |
|
36 <h2>GoogleV2Engine</h2> |
|
37 |
|
38 <p> |
|
39 Class implementing the translation engine for the new Google |
|
40 translation service. |
|
41 </p> |
|
42 <h3>Derived from</h3> |
|
43 TranslationEngine |
|
44 <h3>Class Attributes</h3> |
|
45 |
|
46 <table> |
|
47 <tr><td>TranslatorUrl</td></tr> |
|
48 </table> |
|
49 <h3>Class Methods</h3> |
|
50 |
|
51 <table> |
|
52 <tr><td>None</td></tr> |
|
53 </table> |
|
54 <h3>Methods</h3> |
|
55 |
|
56 <table> |
|
57 |
|
58 <tr> |
|
59 <td><a href="#GoogleV2Engine.__init__">GoogleV2Engine</a></td> |
|
60 <td>Constructor</td> |
|
61 </tr> |
|
62 <tr> |
|
63 <td><a href="#GoogleV2Engine.engineName">engineName</a></td> |
|
64 <td>Public method to return the name of the engine.</td> |
|
65 </tr> |
|
66 <tr> |
|
67 <td><a href="#GoogleV2Engine.getTranslation">getTranslation</a></td> |
|
68 <td>Public method to translate the given text.</td> |
|
69 </tr> |
|
70 <tr> |
|
71 <td><a href="#GoogleV2Engine.supportedLanguages">supportedLanguages</a></td> |
|
72 <td>Public method to get the supported languages.</td> |
|
73 </tr> |
|
74 </table> |
|
75 <h3>Static Methods</h3> |
|
76 |
|
77 <table> |
|
78 <tr><td>None</td></tr> |
|
79 </table> |
|
80 |
|
81 <a NAME="GoogleV2Engine.__init__" ID="GoogleV2Engine.__init__"></a> |
|
82 <h4>GoogleV2Engine (Constructor)</h4> |
|
83 <b>GoogleV2Engine</b>(<i>plugin, parent=None</i>) |
|
84 |
|
85 <p> |
|
86 Constructor |
|
87 </p> |
|
88 <dl> |
|
89 |
|
90 <dt><i>plugin</i> (TranslatorPlugin)</dt> |
|
91 <dd> |
|
92 reference to the plugin object |
|
93 </dd> |
|
94 <dt><i>parent</i> (QObject)</dt> |
|
95 <dd> |
|
96 reference to the parent object |
|
97 </dd> |
|
98 </dl> |
|
99 <a NAME="GoogleV2Engine.engineName" ID="GoogleV2Engine.engineName"></a> |
|
100 <h4>GoogleV2Engine.engineName</h4> |
|
101 <b>engineName</b>(<i></i>) |
|
102 |
|
103 <p> |
|
104 Public method to return the name of the engine. |
|
105 </p> |
|
106 <dl> |
|
107 <dt>Return:</dt> |
|
108 <dd> |
|
109 engine name |
|
110 </dd> |
|
111 </dl> |
|
112 <dl> |
|
113 <dt>Return Type:</dt> |
|
114 <dd> |
|
115 str |
|
116 </dd> |
|
117 </dl> |
|
118 <a NAME="GoogleV2Engine.getTranslation" ID="GoogleV2Engine.getTranslation"></a> |
|
119 <h4>GoogleV2Engine.getTranslation</h4> |
|
120 <b>getTranslation</b>(<i>requestObject, text, originalLanguage, translationLanguage</i>) |
|
121 |
|
122 <p> |
|
123 Public method to translate the given text. |
|
124 </p> |
|
125 <dl> |
|
126 |
|
127 <dt><i>requestObject</i> (TranslatorRequest)</dt> |
|
128 <dd> |
|
129 reference to the request object |
|
130 </dd> |
|
131 <dt><i>text</i> (str)</dt> |
|
132 <dd> |
|
133 text to be translated |
|
134 </dd> |
|
135 <dt><i>originalLanguage</i> (str)</dt> |
|
136 <dd> |
|
137 language code of the original |
|
138 </dd> |
|
139 <dt><i>translationLanguage</i> (str)</dt> |
|
140 <dd> |
|
141 language code of the translation |
|
142 </dd> |
|
143 </dl> |
|
144 <dl> |
|
145 <dt>Return:</dt> |
|
146 <dd> |
|
147 tuple of translated text and flag indicating success |
|
148 </dd> |
|
149 </dl> |
|
150 <dl> |
|
151 <dt>Return Type:</dt> |
|
152 <dd> |
|
153 tuple of (str, bool) |
|
154 </dd> |
|
155 </dl> |
|
156 <a NAME="GoogleV2Engine.supportedLanguages" ID="GoogleV2Engine.supportedLanguages"></a> |
|
157 <h4>GoogleV2Engine.supportedLanguages</h4> |
|
158 <b>supportedLanguages</b>(<i></i>) |
|
159 |
|
160 <p> |
|
161 Public method to get the supported languages. |
|
162 </p> |
|
163 <dl> |
|
164 <dt>Return:</dt> |
|
165 <dd> |
|
166 list of supported language codes |
|
167 </dd> |
|
168 </dl> |
|
169 <dl> |
|
170 <dt>Return Type:</dt> |
|
171 <dd> |
|
172 list of str |
|
173 </dd> |
|
174 </dl> |
|
175 <div align="right"><a href="#top">Up</a></div> |
|
176 <hr /> |
|
177 </body></html> |