|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric6.Plugins.UiExtensionPlugins.Translator.TranslatorEngines.GoogleV2Engine</title> |
|
4 <meta charset="UTF-8"> |
|
5 <style> |
|
6 body { |
|
7 background: #EDECE6; |
|
8 margin: 0em 1em 10em 1em; |
|
9 color: black; |
|
10 } |
|
11 |
|
12 h1 { color: white; background: #85774A; } |
|
13 h2 { color: white; background: #85774A; } |
|
14 h3 { color: white; background: #9D936E; } |
|
15 h4 { color: white; background: #9D936E; } |
|
16 |
|
17 a { color: #BA6D36; } |
|
18 |
|
19 </style> |
|
20 </head> |
|
21 <body><a NAME="top" ID="top"></a> |
|
22 <h1>eric6.Plugins.UiExtensionPlugins.Translator.TranslatorEngines.GoogleV2Engine</h1> |
|
23 <p> |
|
24 Module implementing the Google V2 translation engine. |
|
25 </p> |
|
26 <h3>Global Attributes</h3> |
|
27 <table> |
|
28 <tr><td>None</td></tr> |
|
29 </table> |
|
30 <h3>Classes</h3> |
|
31 <table> |
|
32 <tr> |
|
33 <td><a href="#GoogleV2Engine">GoogleV2Engine</a></td> |
|
34 <td>Class implementing the translation engine for the new Google translation service.</td> |
|
35 </tr> |
|
36 </table> |
|
37 <h3>Functions</h3> |
|
38 <table> |
|
39 <tr><td>None</td></tr> |
|
40 </table> |
|
41 <hr /><hr /> |
|
42 <a NAME="GoogleV2Engine" ID="GoogleV2Engine"></a> |
|
43 <h2>GoogleV2Engine</h2> |
|
44 <p> |
|
45 Class implementing the translation engine for the new Google |
|
46 translation service. |
|
47 </p> |
|
48 <h3>Derived from</h3> |
|
49 TranslationEngine |
|
50 <h3>Class Attributes</h3> |
|
51 <table> |
|
52 <tr><td>TranslatorUrl</td></tr> |
|
53 </table> |
|
54 <h3>Class Methods</h3> |
|
55 <table> |
|
56 <tr><td>None</td></tr> |
|
57 </table> |
|
58 <h3>Methods</h3> |
|
59 <table> |
|
60 <tr> |
|
61 <td><a href="#GoogleV2Engine.__init__">GoogleV2Engine</a></td> |
|
62 <td>Constructor</td> |
|
63 </tr><tr> |
|
64 <td><a href="#GoogleV2Engine.engineName">engineName</a></td> |
|
65 <td>Public method to return the name of the engine.</td> |
|
66 </tr><tr> |
|
67 <td><a href="#GoogleV2Engine.getTranslation">getTranslation</a></td> |
|
68 <td>Public method to translate the given text.</td> |
|
69 </tr><tr> |
|
70 <td><a href="#GoogleV2Engine.supportedLanguages">supportedLanguages</a></td> |
|
71 <td>Public method to get the supported languages.</td> |
|
72 </tr> |
|
73 </table> |
|
74 <h3>Static Methods</h3> |
|
75 <table> |
|
76 <tr><td>None</td></tr> |
|
77 </table> |
|
78 <a NAME="GoogleV2Engine.__init__" ID="GoogleV2Engine.__init__"></a> |
|
79 <h4>GoogleV2Engine (Constructor)</h4> |
|
80 <b>GoogleV2Engine</b>(<i>plugin, parent=None</i>) |
|
81 <p> |
|
82 Constructor |
|
83 </p><dl> |
|
84 <dt><i>plugin</i></dt> |
|
85 <dd> |
|
86 reference to the plugin object (TranslatorPlugin) |
|
87 </dd><dt><i>parent</i></dt> |
|
88 <dd> |
|
89 reference to the parent object (QObject) |
|
90 </dd> |
|
91 </dl><a NAME="GoogleV2Engine.engineName" ID="GoogleV2Engine.engineName"></a> |
|
92 <h4>GoogleV2Engine.engineName</h4> |
|
93 <b>engineName</b>(<i></i>) |
|
94 <p> |
|
95 Public method to return the name of the engine. |
|
96 </p><dl> |
|
97 <dt>Returns:</dt> |
|
98 <dd> |
|
99 engine name (string) |
|
100 </dd> |
|
101 </dl><a NAME="GoogleV2Engine.getTranslation" ID="GoogleV2Engine.getTranslation"></a> |
|
102 <h4>GoogleV2Engine.getTranslation</h4> |
|
103 <b>getTranslation</b>(<i>requestObject, text, originalLanguage, translationLanguage</i>) |
|
104 <p> |
|
105 Public method to translate the given text. |
|
106 </p><dl> |
|
107 <dt><i>requestObject</i></dt> |
|
108 <dd> |
|
109 reference to the request object |
|
110 (TranslatorRequest) |
|
111 </dd><dt><i>text</i></dt> |
|
112 <dd> |
|
113 text to be translated (string) |
|
114 </dd><dt><i>originalLanguage</i></dt> |
|
115 <dd> |
|
116 language code of the original (string) |
|
117 </dd><dt><i>translationLanguage</i></dt> |
|
118 <dd> |
|
119 language code of the translation (string) |
|
120 </dd> |
|
121 </dl><dl> |
|
122 <dt>Returns:</dt> |
|
123 <dd> |
|
124 tuple of translated text (string) and flag indicating |
|
125 success (boolean) |
|
126 </dd> |
|
127 </dl><a NAME="GoogleV2Engine.supportedLanguages" ID="GoogleV2Engine.supportedLanguages"></a> |
|
128 <h4>GoogleV2Engine.supportedLanguages</h4> |
|
129 <b>supportedLanguages</b>(<i></i>) |
|
130 <p> |
|
131 Public method to get the supported languages. |
|
132 </p><dl> |
|
133 <dt>Returns:</dt> |
|
134 <dd> |
|
135 list of supported language codes (list of string) |
|
136 </dd> |
|
137 </dl> |
|
138 <div align="right"><a href="#top">Up</a></div> |
|
139 <hr /> |
|
140 </body></html> |