Index: trunk/extensions/LiveTranslate/includes/ext.livetranslate.js |
— | — | @@ -135,6 +135,8 @@ |
136 | 136 | |
137 | 137 | /** |
138 | 138 | * Inserts notranslate spans around the words specified in the passed array in the page content. |
| 139 | + * |
| 140 | + * @param {Array} words |
139 | 141 | */ |
140 | 142 | function insertNoTranslateTags( words ) { |
141 | 143 | for ( i in words ) { |
— | — | @@ -169,7 +171,7 @@ |
170 | 172 | * Replaced the special words in the page content by looping over them, |
171 | 173 | * and checking if there is a matching translation in the provided object. |
172 | 174 | * |
173 | | - * @param translations |
| 175 | + * @param {object} translations |
174 | 176 | */ |
175 | 177 | function replaceSpecialWords( translations ) { |
176 | 178 | $.each($(".notranslate"), function(i,v) { |
— | — | @@ -183,8 +185,8 @@ |
184 | 186 | /** |
185 | 187 | * Initiates the Google Translate translation. |
186 | 188 | * |
187 | | - * @param sourceLang |
188 | | - * @param targetLang |
| 189 | + * @param {string} sourceLang |
| 190 | + * @param {string} targetLang |
189 | 191 | */ |
190 | 192 | function requestGoogleTranslate( sourceLang, targetLang ) { |
191 | 193 | translateElement( $( '#bodyContent' ), sourceLang, targetLang ); |
— | — | @@ -196,9 +198,9 @@ |
197 | 199 | * |
198 | 200 | * TODO: be smarter with the requests, and make sure they don't get broken up unecesarrily. |
199 | 201 | * |
200 | | - * @param element |
201 | | - * @param sourceLang |
202 | | - * @param targetLang |
| 202 | + * @param {jQuery} element |
| 203 | + * @param {string} sourceLang |
| 204 | + * @param {string} targetLang |
203 | 205 | */ |
204 | 206 | function translateElement( element, sourceLang, targetLang ) { |
205 | 207 | runningJobs++; |
— | — | @@ -234,12 +236,12 @@ |
235 | 237 | * Determines a chunk to translate of an DOM elements contents and calls the Google Translate API. |
236 | 238 | * Then calls itself if there is any remaining word to be done. |
237 | 239 | * |
238 | | - * @param untranslatedScentances |
239 | | - * @param chunks |
240 | | - * @param currentMaxSize |
241 | | - * @param sourceLang |
242 | | - * @param targetLang |
243 | | - * @param element |
| 240 | + * @param {array} untranslatedScentances |
| 241 | + * @param {array} chunks |
| 242 | + * @param {integer} currentMaxSize |
| 243 | + * @param {string} sourceLang |
| 244 | + * @param {string} targetLang |
| 245 | + * @param {jQuery} element |
244 | 246 | */ |
245 | 247 | function translateChunk( untranslatedScentances, chunks, currentMaxSize, sourceLang, targetLang, element ) { |
246 | 248 | var remainingPart = false; |
— | — | @@ -320,7 +322,7 @@ |
321 | 323 | * By use of the runningJobs var, completion of the translation process is detected, |
322 | 324 | * and further handled by this function. |
323 | 325 | * |
324 | | - * @param targetLang |
| 326 | + * @param {string} targetLang |
325 | 327 | */ |
326 | 328 | function handleTranslationCompletion( targetLang ) { |
327 | 329 | if ( !--runningJobs ) { |