Index: trunk/extensions/Translate/utils/MessageTable.php |
— | — | @@ -209,7 +209,7 @@ |
210 | 210 | protected function getReviewButton( TMessage $message ) { |
211 | 211 | global $wgUser; |
212 | 212 | $revision = $message->getProperty( 'revision' ); |
213 | | - if ( !$this->reviewMode || !$wgUser->isAllowed( 'translate-messagereview' ) || !$revision || $message->hasTag( 'fuzzy' ) ) { |
| 213 | + if ( !$this->reviewMode || !$wgUser->isAllowed( 'translate-messagereview' ) || !$revision ) { |
214 | 214 | return ''; |
215 | 215 | } |
216 | 216 | |
— | — | @@ -224,6 +224,14 @@ |
225 | 225 | if ( in_array( $wgUser->getId(), $reviewers ) ) { |
226 | 226 | $attribs['value'] = wfMessage( 'translate-messagereview-done' )->text(); |
227 | 227 | $attribs['disabled'] = 'disabled'; |
| 228 | + } elseif( $message->hasTag( 'fuzzy' ) ) { |
| 229 | + $attribs['value'] = wfMessage( 'translate-messagereview-submit' )->text(); |
| 230 | + $attribs['disabled'] = 'disabled'; |
| 231 | + $attribs['title'] = wfMessage( 'translate-messagereview-no-fuzzy' )->text(); |
| 232 | + } elseif( $wgUser->getName() === $message->author() ) { |
| 233 | + $attribs['value'] = wfMessage( 'translate-messagereview-submit' )->text(); |
| 234 | + $attribs['disabled'] = 'disabled'; |
| 235 | + $attribs['title'] = wfMessage( 'translate-messagereview-no-own' )->text(); |
228 | 236 | } else { |
229 | 237 | $attribs['value'] = wfMessage( 'translate-messagereview-submit' )->text(); |
230 | 238 | } |
Index: trunk/extensions/Translate/Translate.i18n.php |
— | — | @@ -374,10 +374,14 @@ |
375 | 375 | 'translate-messagereview-done' => 'Reviewed', |
376 | 376 | 'translate-messagereview-apierror-invalidrevision' => 'Translation was not found', |
377 | 377 | 'translate-messagereview-apierror-unknownmessage' => 'Message was not found', |
378 | | - 'translate-messagereview-apierror-fuzzymessage' => 'Message is marked as fuzzy', |
| 378 | + 'translate-messagereview-apierror-fuzzymessage' => 'Translation is marked as fuzzy', |
| 379 | + 'translate-messagereview-apierror-owntranslation' => 'You cannot review your own translations.', |
379 | 380 | 'translate-messagereview-reviews' => 'Reviewed by {{PLURAL:$1|one user|$1 users}}', |
380 | 381 | 'translate-messagereview-reviewswithyou' => 'Reviewed by {{PLURAL:$1|one user|$1 users}} including you', |
381 | 382 | 'translate-messagereview-reviewsyou' => 'Reviewed by you', |
| 383 | + |
| 384 | + 'translate-messagereview-no-fuzzy' => 'Fuzzy translations cannot be reviewed', |
| 385 | + 'translate-messagereview-no-own' => 'You cannot review your own translations', |
382 | 386 | ); |
383 | 387 | |
384 | 388 | /** Message documentation (Message documentation) |
— | — | @@ -595,9 +599,12 @@ |
596 | 600 | 'translate-messagereview-apierror-invalidrevision' => 'Error message for {{msg-mw|translate-messagereview-failure}}', |
597 | 601 | 'translate-messagereview-apierror-unknownmessage' => 'Error message for {{msg-mw|translate-messagereview-failure}}', |
598 | 602 | 'translate-messagereview-apierror-fuzzymessage' => 'Error message for {{msg-mw|translate-messagereview-failure}}', |
| 603 | + 'translate-messagereview-apierror-owntranslation' => 'Error message for {{msg-mw|translate-messagereview-failure}}', |
599 | 604 | 'translate-messagereview-reviews' => 'Status message in Special:Translate in review mode', |
600 | 605 | 'translate-messagereview-reviewswithyou' => 'Status message in Special:Translate in review mode', |
601 | 606 | 'translate-messagereview-reviewsyou' => 'Status message in Special:Translate in review mode', |
| 607 | + 'translate-messagereview-no-fuzzy' => 'Tooltip for disabled review button', |
| 608 | + 'translate-messagereview-no-own' => 'Tooltip for disabled review button', |
602 | 609 | ); |
603 | 610 | |
604 | 611 | /** Faeag Rotuma (Faeag Rotuma) |
Index: trunk/extensions/Translate/api/ApiTranslationReview.php |
— | — | @@ -34,9 +34,13 @@ |
35 | 35 | } |
36 | 36 | |
37 | 37 | if ( $handle->isFuzzy() ) { |
38 | | - $this->dieUsage( 'Cannot review fuzzy messages', 'fuzzymessage' ); |
| 38 | + $this->dieUsage( 'Cannot review fuzzy translations', 'fuzzymessage' ); |
39 | 39 | } |
40 | 40 | |
| 41 | + if ( $revision->getUser() == $wgUser->getId() ) { |
| 42 | + $this->dieUsage( 'Cannot review own translations', 'owntranslation' ); |
| 43 | + } |
| 44 | + |
41 | 45 | $dbw = wfGetDB( DB_MASTER ); |
42 | 46 | $table = 'translate_reviews'; |
43 | 47 | $row = array( |
— | — | @@ -99,7 +103,8 @@ |
100 | 104 | return array_merge( parent::getPossibleErrors(), array( |
101 | 105 | array( 'code' => 'permissiondenied', 'info' => 'You must have translate-messagereview right' ), |
102 | 106 | array( 'code' => 'unknownmessage', 'info' => 'Title $1 does not belong to a message group' ), |
103 | | - array( 'code' => 'fuzzymessage', 'info' => 'Cannot review fuzzy messages' ), |
| 107 | + array( 'code' => 'fuzzymessage', 'info' => 'Cannot review fuzzy translations' ), |
| 108 | + array( 'code' => 'owntranslation', 'info' => 'Cannot review own translations' ), |
104 | 109 | array( 'code' => 'invalidrevision', 'info' => 'Revision $1 is invalid' ), |
105 | 110 | ) ); |
106 | 111 | } |