Index: trunk/extensions/Translate/Translate.php |
— | — | @@ -189,6 +189,9 @@ |
190 | 190 | 'translate-messagereview-done', |
191 | 191 | 'translate-messagereview-apierror-invalidrevision', |
192 | 192 | 'translate-messagereview-apierror-unknownmessage', |
| 193 | + 'translate-messagereview-apierror-badtoken', |
| 194 | + 'translate-messagereview-apierror-fuzzymessage', |
| 195 | + 'translate-messagereview-apierror-owntranslation', |
193 | 196 | ), |
194 | 197 | ) + $resourcePaths; |
195 | 198 | |
Index: trunk/extensions/Translate/Translate.i18n.php |
— | — | @@ -377,7 +377,8 @@ |
378 | 378 | 'translate-messagereview-apierror-invalidrevision' => 'Translation was not found', |
379 | 379 | 'translate-messagereview-apierror-unknownmessage' => 'Message was not found', |
380 | 380 | 'translate-messagereview-apierror-fuzzymessage' => 'Translation is marked as fuzzy', |
381 | | - 'translate-messagereview-apierror-owntranslation' => 'You cannot accept your own translations.', |
| 381 | + 'translate-messagereview-apierror-owntranslation' => 'You cannot accept your own translations', |
| 382 | + 'translate-messagereview-apierror-badtoken' => 'Invalid token', |
382 | 383 | 'translate-messagereview-reviews' => 'Accepted by {{PLURAL:$1|one user|$1 users}}', |
383 | 384 | 'translate-messagereview-reviewswithyou' => 'Accepted by {{PLURAL:$1|one user|$1 users}} including you', |
384 | 385 | 'translate-messagereview-reviewsyou' => 'Accepted by you', |
Index: trunk/extensions/Translate/resources/ext.translate.messagetable.js |
— | — | @@ -1,27 +1,28 @@ |
2 | | -jQuery( document ).ready( function( $ ) { |
3 | | - var $buttons = $( ".mw-translate-messagereviewbutton" ); |
4 | | - $buttons.each( function() { |
| 2 | +jQuery( function( $ ) { |
| 3 | + $( ".mw-translate-messagereviewbutton" ).click( function() { |
5 | 4 | var $b = $(this); |
6 | | - $b.click( function() { |
7 | | - var successFunction = function( data, textStatus ) { |
8 | | - if ( data.error ) { |
9 | | - var reason = mw.msg( "translate-messagereview-apierror-" + data.error.code ); |
10 | | - $b.val( mw.msg( "translate-messagereview-failure", reason ) ); |
11 | | - } else { |
12 | | - $b.val( mw.msg( "translate-messagereview-done" ) ); |
13 | | - } |
14 | | - }; |
15 | 5 | |
16 | | - var params = { |
17 | | - action: "translationreview", |
18 | | - token: $b.data( "token" ), |
19 | | - revision: $b.data( "revision" ), |
20 | | - format: "json" |
21 | | - }; |
22 | | - $b.val( mw.msg( "translate-messagereview-progress" ) ); |
23 | | - $b.prop( "disabled", true ); |
24 | | - $.post( mw.util.wikiScript( "api" ), params, successFunction ); |
| 6 | + var successFunction = function( data, textStatus ) { |
| 7 | + if ( data.error ) { |
| 8 | + var reason = mw.msg( "translate-messagereview-apierror-" + data.error.code ); |
| 9 | + $b.val( mw.msg( "translate-messagereview-failure", reason ) ); |
| 10 | + } else { |
| 11 | + $b.val( mw.msg( "translate-messagereview-done" ) ); |
| 12 | + } |
| 13 | + }; |
| 14 | + |
| 15 | + var failFunction = function( jqXHR, textStatus ) { |
| 16 | + $b.val( mw.msg( "translate-messagereview-failure", jqXHR.statusText ) ); |
| 17 | + }; |
25 | 18 | |
26 | | - } ); |
| 19 | + var params = { |
| 20 | + action: "translationreview", |
| 21 | + token: $b.data( "token" ), |
| 22 | + revision: $b.data( "revision" ), |
| 23 | + format: "json" |
| 24 | + }; |
| 25 | + $b.val( mw.msg( "translate-messagereview-progress" ) ); |
| 26 | + $b.prop( "disabled", true ); |
| 27 | + $.post( mw.util.wikiScript( "api" ), params, successFunction ).fail( failFunction ); |
27 | 28 | } ); |
28 | 29 | } ); |