diff options
Diffstat (limited to 'MLEB/Translate/scripts/fuzzy.php')
-rw-r--r-- | MLEB/Translate/scripts/fuzzy.php | 34 |
1 files changed, 8 insertions, 26 deletions
diff --git a/MLEB/Translate/scripts/fuzzy.php b/MLEB/Translate/scripts/fuzzy.php index 549409bf..1244f2e2 100644 --- a/MLEB/Translate/scripts/fuzzy.php +++ b/MLEB/Translate/scripts/fuzzy.php @@ -10,7 +10,7 @@ */ // Standard boilerplate to define $IP -use MediaWiki\Extensions\Translate\SystemUsers\FuzzyBot; +use MediaWiki\Extension\Translate\SystemUsers\FuzzyBot; use MediaWiki\MediaWikiServices; use MediaWiki\Revision\SlotRecord; use Wikimedia\Rdbms\IResultWrapper; @@ -97,35 +97,20 @@ class Fuzzy extends Maintenance { * Class for marking translation fuzzy. */ class FuzzyScript { - /** - * @var bool Check for configuration problems. - */ - private $allclear = false; - + /** @var bool Check for configuration problems. */ + private $allclear = true; /** @var callable Function to report progress updates */ protected $progressCallback; - - /** - * @var bool Dont do anything unless confirmation is given - */ + /** @var bool Dont do anything unless confirmation is given */ public $dryrun = true; - - /** - * @var string Edit summary. - */ + /** @var string Edit summary. */ public $comment; - - /** - * @var array[] - */ + /** @var array[] */ public $pages; - /** - * @param array $pages - */ + /** @param array $pages */ public function __construct( $pages ) { $this->pages = $pages; - $this->allclear = true; } public function setProgressCallback( $callback ) { @@ -163,10 +148,7 @@ class FuzzyScript { private static function getMessageContentsFromRows( $rows ) { $revStore = MediaWikiServices::getInstance()->getRevisionStore(); $messagesContents = []; - $slots = []; - if ( is_callable( [ $revStore, 'getContentBlobsForBatch' ] ) ) { - $slots = $revStore->getContentBlobsForBatch( $rows, [ SlotRecord::MAIN ] )->getValue(); - } + $slots = $revStore->getContentBlobsForBatch( $rows, [ SlotRecord::MAIN ] )->getValue(); foreach ( $rows as $row ) { $title = Title::makeTitle( $row->page_namespace, $row->page_title ); if ( isset( $slots[$row->rev_id] ) ) { |