Index: trunk/extensions/Translate/tag/TranslatablePage.php |
— | — | @@ -478,10 +478,9 @@ |
479 | 479 | $memcKey = wfMemcKey( 'pt', 'status', $this->getTitle()->getPrefixedText() ); |
480 | 480 | $cache = $wgMemc->get( $memcKey ); |
481 | 481 | |
482 | | - if ( !$force && $wgRequest->getText( 'action' ) !== 'purge' ) { |
483 | | - if ( is_array( $cache ) ) { |
484 | | - return $cache; |
485 | | - } |
| 482 | + $force = $force || $wgRequest->getText( 'action' ) === 'purge'; |
| 483 | + if ( !$force && is_array( $cache ) ) { |
| 484 | + return $cache; |
486 | 485 | } |
487 | 486 | |
488 | 487 | $titles = $this->getTranslationPages(); |
— | — | @@ -532,21 +531,24 @@ |
533 | 532 | // Fuzzy halves score |
534 | 533 | if ( $message->hasTag( 'fuzzy' ) ) { |
535 | 534 | $score *= 0.5; |
536 | | - } |
537 | 535 | |
538 | | - // Reduce 20% for every newer revision than what is translated against |
539 | | - $rev = $this->getTransrev( $key . '/' . $collection->code ); |
540 | | - foreach ( $markedRevs as $r ) { |
541 | | - if ( $rev === $r->rt_revision ) break; |
542 | | - $changed = explode( '|', unserialize( $r->rt_value ) ); |
| 536 | + /* Reduce 20% for every newer revision than what is translated against. |
| 537 | + * This is inside fuzzy clause, because there might be silent changes |
| 538 | + * which we don't want to decrease the translation percentage. |
| 539 | + */ |
| 540 | + $rev = $this->getTransrev( $key . '/' . $collection->code ); |
| 541 | + foreach ( $markedRevs as $r ) { |
| 542 | + if ( $rev === $r->rt_revision ) break; |
| 543 | + $changed = explode( '|', unserialize( $r->rt_value ) ); |
543 | 544 | |
544 | | - // Get a suitable section key |
545 | | - $parts = explode( '/', $key ); |
546 | | - $ikey = $parts[count( $parts ) - 1]; |
| 545 | + // Get a suitable section key |
| 546 | + $parts = explode( '/', $key ); |
| 547 | + $ikey = $parts[count( $parts ) - 1]; |
547 | 548 | |
548 | | - // If the section was changed, reduce the score |
549 | | - if ( in_array( $ikey, $changed, true ) ) { |
550 | | - $score *= 0.8; |
| 549 | + // If the section was changed, reduce the score |
| 550 | + if ( in_array( $ikey, $changed, true ) ) { |
| 551 | + $score *= 0.8; |
| 552 | + } |
551 | 553 | } |
552 | 554 | } |
553 | 555 | $total += $score; |
Index: trunk/extensions/Translate/tag/SpecialPageTranslation.php |
— | — | @@ -487,7 +487,8 @@ |
488 | 488 | $dbw->delete( 'translate_sections', array( 'trs_page' => $page->getTitle()->getArticleId() ), __METHOD__ ); |
489 | 489 | $ok = $dbw->insert( 'translate_sections', $inserts, __METHOD__ ); |
490 | 490 | |
491 | | - // Stores the names of changed sections in the database. Not currently used for anything. |
| 491 | + /* Stores the names of changed sections in the database. |
| 492 | + * Used for calculating completion percentages for outdated messages */ |
492 | 493 | $page->addMarkedTag( $newrevision, $changed ); |
493 | 494 | $this->addFuzzyTags( $page, $changed ); |
494 | 495 | |