46 private const MAX_ITEMS_PER_QUERY = 2000;
47 public const FILTER_FUZZY =
'fuzzy';
48 public const FILTER_OPTIONAL =
'optional';
49 public const FILTER_IGNORED =
'ignored';
50 public const FILTER_HAS_TRANSLATION =
'hastranslation';
51 public const FILTER_CHANGED =
'changed';
52 public const FILTER_TRANSLATED =
'translated';
53 public const FILTER_REVIEWER =
'reviewer';
54 public const FILTER_LAST_TRANSLATOR =
'last-translator';
55 private const AVAILABLE_FILTERS = [
57 self::FILTER_OPTIONAL,
59 self::FILTER_HAS_TRANSLATION,
61 self::FILTER_TRANSLATED,
62 self::FILTER_REVIEWER,
63 self::FILTER_LAST_TRANSLATOR,
65 public const INCLUDE_MATCHING =
false;
66 public const EXCLUDE_MATCHING =
true;
72 private array $infile = [];
76 protected array $keys = [];
79 private ?array $reverseMap =
null;
83 private Traversable $dbInfo;
85 private Traversable $dbData;
87 private Traversable $dbReviewData;
93 protected array $tags = [];
95 private array $authors = [];
111 $collection = new self(
$code );
112 $collection->definitions = $definitions;
113 $collection->resetForNewLanguage(
$code );
118 public function getLanguage(): string {
130 $this->infile = $messages;
138 public function setTags(
string $type, array $keys ): void {
139 $this->tags[$type] = $keys;
146 public function keys(): array {
154 private function getTitles(): array {
155 return array_values( $this->keys );
163 return array_keys( $this->keys );
171 public function getTags(
string $type ): array {
172 return $this->tags[$type] ?? [];
182 $this->loadTranslations();
184 $authors = array_flip( $this->authors );
186 foreach ( $this->messages as $m ) {
189 $author = $m->getProperty(
'last-translator-text' );
191 if ( $author ===
null ) {
195 if ( !isset( $authors[$author] ) ) {
196 $authors[$author] = 1;
202 # arsort( $authors, SORT_NUMERIC );
204 $fuzzyBot = FuzzyBot::getName();
205 $filteredAuthors = [];
206 foreach ( $authors as $author => $edits ) {
207 if ( $author !== $fuzzyBot ) {
208 $filteredAuthors[] = (string)$author;
212 return $filteredAuthors;
223 $authors = array_merge( $this->authors, $authors );
228 throw new InvalidArgumentException(
"Invalid mode $mode" );
231 $this->authors = array_unique( $authors );
244 $titleConds = $this->getTitleConds( $dbr );
246 $this->loadData( $this->keys, $titleConds );
247 $this->loadInfo( $this->keys, $titleConds );
248 $this->loadReviewInfo( $this->keys, $titleConds );
249 $this->initMessages();
258 $this->keys = $this->fixKeys();
259 $this->dbInfo =
new EmptyIterator();
260 $this->dbData =
new EmptyIterator();
261 $this->dbReviewData =
new EmptyIterator();
262 $this->messages =
null;
266 unset( $this->tags[
'fuzzy'] );
267 $this->reverseMap =
null;
277 public function slice( $offset, $limit ) {
278 $indexes = array_keys( $this->keys );
280 if ( $offset ===
'' ) {
285 if ( !ctype_digit( (
string)$offset ) ) {
286 $pos = array_search( $offset, array_keys( $this->keys ),
true );
288 $offset = $pos !==
false ? $pos : count( $this->keys );
290 $offset = (int)$offset;
294 $backwardsOffset = $forwardsOffset =
false;
304 $backwardsOffset = (string)( max( 0, $offset - $limit ) );
317 if ( isset( $indexes[$offset + $limit] ) ) {
318 $forwardsOffset = $indexes[$offset + $limit];
321 $this->keys = array_slice( $this->keys, $offset, $limit,
true );
323 return [ $backwardsOffset, $forwardsOffset, $offset ];
352 public function filter(
string $filter,
bool $condition, ?
int $value =
null ): void {
353 if ( !in_array( $filter, self::AVAILABLE_FILTERS, true ) ) {
358 if ( $filter === self::FILTER_FUZZY ) {
359 $keys = $this->filterFuzzy( $keys, $condition );
360 } elseif ( $filter === self::FILTER_HAS_TRANSLATION ) {
361 $keys = $this->filterHastranslation( $keys, $condition );
362 } elseif ( $filter === self::FILTER_TRANSLATED ) {
363 $fuzzy = $this->filterFuzzy( $keys, self::INCLUDE_MATCHING );
364 $hastranslation = $this->filterHastranslation( $keys, self::INCLUDE_MATCHING );
366 $translated = $this->filterOnCondition( $hastranslation, $fuzzy );
367 $keys = $this->filterOnCondition( $keys, $translated, $condition );
368 } elseif ( $filter === self::FILTER_CHANGED ) {
369 $keys = $this->filterChanged( $keys, $condition );
370 } elseif ( $filter === self::FILTER_REVIEWER ) {
371 $keys = $this->filterReviewer( $keys, $condition, $value );
372 } elseif ( $filter === self::FILTER_LAST_TRANSLATOR ) {
373 $keys = $this->filterLastTranslator( $keys, $condition, $value );
375 if ( !isset( $this->tags[$filter] ) ) {
376 if ( $filter !== self::FILTER_OPTIONAL && $filter !== self::FILTER_IGNORED ) {
377 throw new RuntimeException(
"No tagged messages for custom filter $filter" );
379 $keys = $this->filterOnCondition( $keys, [], $condition );
381 $taggedKeys = array_flip( $this->tags[$filter] );
382 $keys = $this->filterOnCondition( $keys, $taggedKeys, $condition );
390 public function filterUntranslatedOptional(): void {
391 $optionalKeys = array_flip( $this->tags[
'optional'] ?? [] );
393 $optional = $this->filterOnCondition( $this->keys, $optionalKeys, self::INCLUDE_MATCHING );
396 $this->loadInfo( $this->keys );
397 $untranslatedOptional = $this->filterHastranslation( $optional, self::EXCLUDE_MATCHING );
399 $this->keys = $this->filterOnCondition( $this->keys, $untranslatedOptional );
417 private function filterOnCondition( array $keys, array $condKeys,
bool $condition =
true ): array {
418 if ( $condition === self::EXCLUDE_MATCHING ) {
420 foreach ( array_keys( $condKeys ) as $key ) {
421 unset( $keys[$key] );
425 foreach ( array_keys( $keys ) as $key ) {
426 if ( !isset( $condKeys[$key] ) ) {
427 unset( $keys[$key] );
442 private function filterFuzzy( array $keys,
bool $condition ): array {
443 $this->loadInfo( $keys );
446 if ( $condition === self::INCLUDE_MATCHING ) {
450 foreach ( $this->dbInfo as $row ) {
451 if ( $row->rt_type !==
null ) {
452 unset( $keys[$this->rowToKey( $row )] );
456 if ( $condition === self::INCLUDE_MATCHING ) {
457 $keys = array_diff( $origKeys, $keys );
470 private function filterHastranslation( array $keys,
bool $condition ): array {
471 $this->loadInfo( $keys );
474 if ( $condition === self::INCLUDE_MATCHING ) {
478 foreach ( $this->dbInfo as $row ) {
479 unset( $keys[$this->rowToKey( $row )] );
483 foreach ( array_keys( $this->infile ) as $inf ) {
484 unset( $keys[$inf] );
488 if ( $condition === self::INCLUDE_MATCHING ) {
489 $keys = array_diff( $origKeys, $keys );
503 private function filterChanged( array $keys,
bool $condition ): array {
504 $this->loadData( $keys );
507 if ( $condition === self::INCLUDE_MATCHING ) {
511 $revStore = MediaWikiServices::getInstance()->getRevisionStore();
513 foreach ( $this->dbData as $row ) {
514 $mkey = $this->rowToKey( $row );
515 if ( isset( $this->infile[$mkey] ) ) {
516 $infileRows[] = $row;
520 $revisions = $revStore->newRevisionsFromBatch( $infileRows, [
521 'slots' => [ SlotRecord::MAIN ],
524 foreach ( $infileRows as $row ) {
526 $rev = $revisions[$row->rev_id];
529 $content = $rev->getContent( SlotRecord::MAIN );
531 $mkey = $this->rowToKey( $row );
532 if ( $this->infile[$mkey] === $content->getText() ) {
534 unset( $keys[$mkey] );
541 if ( $condition === self::INCLUDE_MATCHING ) {
542 $keys = $this->filterOnCondition( $origKeys, $keys );
556 private function filterReviewer( array $keys,
bool $condition, ?
int $userId ): array {
557 $this->loadReviewInfo( $keys );
562 foreach ( $this->dbReviewData as $row ) {
563 if ( $userId ===
null || (
int)$row->trr_user === $userId ) {
564 unset( $keys[$this->rowToKey( $row )] );
568 if ( $condition === self::INCLUDE_MATCHING ) {
569 $keys = array_diff( $origKeys, $keys );
581 private function filterLastTranslator( array $keys,
bool $condition, ?
int $userId ): array {
582 $this->loadData( $keys );
586 foreach ( $this->dbData as $row ) {
587 if ( (
int)$row->rev_user === $userId ) {
588 unset( $keys[$this->rowToKey( $row )] );
592 if ( $condition === self::INCLUDE_MATCHING ) {
593 $keys = array_diff( $origKeys, $keys );
603 private function fixKeys(): array {
606 $pages = $this->definitions->getPages();
607 foreach ( $pages as $key => $baseTitle ) {
608 $newkeys[$key] =
new TitleValue(
609 $baseTitle->getNamespace(),
610 $baseTitle->getDBkey() .
'/' . $this->code
622 private function loadInfo( array $keys, ?array $titleConds =
null ): void {
623 if ( !$this->dbInfo instanceof EmptyIterator ) {
627 if ( !count( $keys ) ) {
628 $this->dbInfo =
new EmptyIterator();
632 $dbr = Utilities::getSafeReadDB();
634 $titleConds ??= $this->getTitleConds( $dbr );
635 $iterator =
new AppendIterator();
636 foreach ( $titleConds as $conds ) {
637 $queryResults = $dbr->newSelectQueryBuilder()
638 ->select( [
'page_namespace',
'page_title',
'rt_type' ] )
640 ->leftJoin(
'revtag',
null, [
642 'page_latest=rt_revision',
643 'rt_type' => RevTagStore::FUZZY_TAG,
646 ->caller( __METHOD__ )
648 $iterator->append( $queryResults );
651 $this->dbInfo = $iterator;
656 $this->getReverseMap();
664 private function loadReviewInfo( array $keys, ?array $titleConds =
null ): void {
665 if ( !$this->dbReviewData instanceof EmptyIterator ) {
669 if ( !count( $keys ) ) {
670 $this->dbReviewData =
new EmptyIterator();
674 $dbr = Utilities::getSafeReadDB();
676 $titleConds ??= $this->getTitleConds( $dbr );
677 $iterator =
new AppendIterator();
678 foreach ( $titleConds as $conds ) {
679 $queryResults = $dbr->newSelectQueryBuilder()
680 ->select( [
'page_namespace',
'page_title',
'trr_user' ] )
682 ->join(
'translate_reviews',
null, [
'page_id=trr_page',
'page_latest=trr_revision' ] )
684 ->caller( __METHOD__ )
686 $iterator->append( $queryResults );
689 $this->dbReviewData = $iterator;
694 $this->getReverseMap();
702 private function loadData( array $keys, ?array $titleConds =
null ): void {
703 if ( !$this->dbData instanceof EmptyIterator ) {
707 if ( !count( $keys ) ) {
708 $this->dbData =
new EmptyIterator();
712 $dbr = Utilities::getSafeReadDB();
713 $revisionStore = MediaWikiServices::getInstance()->getRevisionStore();
715 $titleConds ??= $this->getTitleConds( $dbr );
716 $iterator =
new AppendIterator();
717 foreach ( $titleConds as $conds ) {
718 $queryResults = $revisionStore->newSelectQueryBuilder( $dbr )
722 ->andWhere( [
'page_latest = rev_id' ] )
723 ->caller( __METHOD__ )
725 $iterator->append( $queryResults );
728 $this->dbData = $iterator;
733 $this->getReverseMap();
740 private function getTitleConds( IDatabase $db ): array {
741 $titles = $this->getTitles();
742 $chunks = array_chunk( $titles, self::MAX_ITEMS_PER_QUERY );
745 foreach ( $chunks as $titles ) {
748 foreach ( $titles as $title ) {
749 $namespace = $title->getNamespace();
750 $pagename = $title->getDBkey();
751 $byNamespace[$namespace][] = $pagename;
755 foreach ( $byNamespace as $namespaces => $pagenames ) {
757 'page_namespace' => $namespaces,
758 'page_title' => $pagenames,
761 $conds[] = $db->makeList( $cond, LIST_AND );
764 $results[] = $db->makeList( $conds, LIST_OR );
775 private function rowToKey( stdClass $row ): ?string {
776 $map = $this->getReverseMap();
777 if ( isset( $map[$row->page_namespace][$row->page_title] ) ) {
778 return $map[$row->page_namespace][$row->page_title];
780 wfWarn(
"Got unknown title from the database: {$row->page_namespace}:{$row->page_title}" );
787 private function getReverseMap(): array {
788 if ( $this->reverseMap !== null ) {
789 return $this->reverseMap;
794 foreach ( $this->keys as $mkey => $title ) {
795 $map[$title->getNamespace()][$title->getDBkey()] = $mkey;
798 $this->reverseMap = $map;
799 return $this->reverseMap;
807 if ( $this->messages !== null ) {
813 $revStore = MediaWikiServices::getInstance()->getRevisionStore();
814 $queryFlags = Utilities::shouldReadFromPrimary() ? IDBAccessObject::READ_LATEST : 0;
815 foreach ( array_keys( $this->keys ) as $mkey ) {
816 $messages[$mkey] =
new ThinMessage( $mkey, $definitions[$mkey] );
819 if ( !$this->dbData instanceof EmptyIterator ) {
820 $slotRows = $revStore->getContentBlobsForBatch(
822 [ SlotRecord::MAIN ],
826 foreach ( $this->dbData as $row ) {
827 $mkey = $this->rowToKey( $row );
828 if ( !isset( $messages[$mkey] ) ) {
831 $messages[$mkey]->setRow( $row );
832 $messages[$mkey]->setProperty(
'revision', $row->page_latest );
834 if ( isset( $slotRows[$row->rev_id][SlotRecord::MAIN] ) ) {
835 $slot = $slotRows[$row->rev_id][SlotRecord::MAIN];
836 $messages[$mkey]->setTranslation( $slot->blob_data );
842 foreach ( $this->dbInfo as $row ) {
843 if ( $row->rt_type !==
null ) {
844 $fuzzy[] = $this->rowToKey( $row );
848 $this->setTags(
'fuzzy', $fuzzy );
851 foreach ( $this->tags as $type => $keys ) {
852 foreach ( $keys as $mkey ) {
853 if ( isset( $messages[$mkey] ) ) {
854 $messages[$mkey]->addTag( $type );
860 foreach ( $this->infile as $mkey => $value ) {
861 if ( isset( $messages[$mkey] ) ) {
862 $messages[$mkey]->setInfile( $value );
866 foreach ( $this->dbReviewData as $row ) {
867 $mkey = $this->rowToKey( $row );
868 if ( !isset( $messages[$mkey] ) ) {
871 $messages[$mkey]->appendProperty(
'reviewers', $row->trr_user );
875 foreach ( $messages as $obj ) {
876 if ( $obj->hasTag(
'fuzzy' ) ) {
877 $obj->setProperty(
'status',
'fuzzy' );
878 } elseif ( is_array( $obj->getProperty(
'reviewers' ) ) ) {
879 $obj->setProperty(
'status',
'proofread' );
880 } elseif ( $obj->translation() !==
null ) {
881 $obj->setProperty(
'status',
'translated' );
883 $obj->setProperty(
'status',
'untranslated' );
887 $this->messages = $messages;
895 return isset( $this->keys[$offset] );
900 return $this->messages[$offset] ?? null;
908 $this->messages[$offset] = $value;
913 unset( $this->keys[$offset] );
922 public function __get(
string $name ): void {
923 throw new LogicException( __METHOD__ .
": Trying to access unknown property $name" );
931 public function __set(
string $name, $value ): void {
932 throw new LogicException( __METHOD__ .
": Trying to modify unknown property $name" );
941 reset( $this->keys );
945 #[\ReturnTypeWillChange]
947 if ( !count( $this->keys ) ) {
952 return $this->messages[key( $this->keys )];
955 public function key(): ?string {
956 return key( $this->keys );
959 public function next(): void {
963 public function valid(): bool {
964 return isset( $this->messages[key( $this->keys )] );
967 public function count(): int {
968 return count( $this->keys() );
return[ 'Translate:AggregateGroupManager'=> static function(MediaWikiServices $services):AggregateGroupManager { return new AggregateGroupManager($services->getTitleFactory(), $services->get( 'Translate:MessageGroupMetadata'));}, 'Translate:AggregateGroupMessageGroupFactory'=> static function(MediaWikiServices $services):AggregateGroupMessageGroupFactory { return new AggregateGroupMessageGroupFactory($services->get( 'Translate:MessageGroupMetadata'));}, 'Translate:ConfigHelper'=> static function():ConfigHelper { return new ConfigHelper();}, 'Translate:CsvTranslationImporter'=> static function(MediaWikiServices $services):CsvTranslationImporter { return new CsvTranslationImporter( $services->getWikiPageFactory());}, 'Translate:EntitySearch'=> static function(MediaWikiServices $services):EntitySearch { return new EntitySearch($services->getMainWANObjectCache(), $services->getCollationFactory() ->makeCollation( 'uca-default-u-kn'), MessageGroups::singleton(), $services->getNamespaceInfo(), $services->get( 'Translate:MessageIndex'), $services->getTitleParser(), $services->getTitleFormatter());}, 'Translate:ExternalMessageSourceStateComparator'=> static function(MediaWikiServices $services):ExternalMessageSourceStateComparator { return new ExternalMessageSourceStateComparator(new SimpleStringComparator(), $services->getRevisionLookup(), $services->getPageStore());}, 'Translate:ExternalMessageSourceStateImporter'=> static function(MediaWikiServices $services):ExternalMessageSourceStateImporter { return new ExternalMessageSourceStateImporter($services->get( 'Translate:GroupSynchronizationCache'), $services->getJobQueueGroup(), LoggerFactory::getInstance(LogNames::GROUP_SYNCHRONIZATION), $services->get( 'Translate:MessageIndex'), $services->getTitleFactory(), $services->get( 'Translate:MessageGroupSubscription'), new ServiceOptions(ExternalMessageSourceStateImporter::CONSTRUCTOR_OPTIONS, $services->getMainConfig()));}, 'Translate:FileBasedMessageGroupFactory'=> static function(MediaWikiServices $services):FileBasedMessageGroupFactory { return new FileBasedMessageGroupFactory(new MessageGroupConfigurationParser(), new ServiceOptions(FileBasedMessageGroupFactory::SERVICE_OPTIONS, $services->getMainConfig()),);}, 'Translate:FileFormatFactory'=> static function(MediaWikiServices $services):FileFormatFactory { return new FileFormatFactory( $services->getObjectFactory());}, 'Translate:GroupSynchronizationCache'=> static function(MediaWikiServices $services):GroupSynchronizationCache { return new GroupSynchronizationCache( $services->get( 'Translate:PersistentCache'));}, 'Translate:HookDefinedMessageGroupFactory'=> static function(MediaWikiServices $services):HookDefinedMessageGroupFactory { return new HookDefinedMessageGroupFactory( $services->get( 'Translate:HookRunner'));}, 'Translate:HookRunner'=> static function(MediaWikiServices $services):HookRunner { return new HookRunner( $services->getHookContainer());}, 'Translate:MessageBundleDependencyPurger'=> static function(MediaWikiServices $services):MessageBundleDependencyPurger { return new MessageBundleDependencyPurger( $services->get( 'Translate:TranslatableBundleFactory'));}, 'Translate:MessageBundleMessageGroupFactory'=> static function(MediaWikiServices $services):MessageBundleMessageGroupFactory { return new MessageBundleMessageGroupFactory($services->get( 'Translate:MessageGroupMetadata'), new ServiceOptions(MessageBundleMessageGroupFactory::SERVICE_OPTIONS, $services->getMainConfig()),);}, 'Translate:MessageBundleStore'=> static function(MediaWikiServices $services):MessageBundleStore { return new MessageBundleStore($services->get( 'Translate:RevTagStore'), $services->getJobQueueGroup(), $services->getLanguageNameUtils(), $services->get( 'Translate:MessageIndex'), $services->get( 'Translate:MessageGroupMetadata'));}, 'Translate:MessageBundleTranslationLoader'=> static function(MediaWikiServices $services):MessageBundleTranslationLoader { return new MessageBundleTranslationLoader( $services->getLanguageFallback());}, 'Translate:MessageGroupMetadata'=> static function(MediaWikiServices $services):MessageGroupMetadata { return new MessageGroupMetadata( $services->getConnectionProvider());}, 'Translate:MessageGroupReviewStore'=> static function(MediaWikiServices $services):MessageGroupReviewStore { return new MessageGroupReviewStore($services->getConnectionProvider(), $services->get( 'Translate:HookRunner'));}, 'Translate:MessageGroupStatsTableFactory'=> static function(MediaWikiServices $services):MessageGroupStatsTableFactory { return new MessageGroupStatsTableFactory($services->get( 'Translate:ProgressStatsTableFactory'), $services->getLinkRenderer(), $services->get( 'Translate:MessageGroupReviewStore'), $services->get( 'Translate:MessageGroupMetadata'), $services->getMainConfig() ->get( 'TranslateWorkflowStates') !==false);}, 'Translate:MessageGroupSubscription'=> static function(MediaWikiServices $services):MessageGroupSubscription { return new MessageGroupSubscription($services->get( 'Translate:MessageGroupSubscriptionStore'), $services->getJobQueueGroup(), $services->getUserIdentityLookup(), LoggerFactory::getInstance(LogNames::GROUP_SUBSCRIPTION), new ServiceOptions(MessageGroupSubscription::CONSTRUCTOR_OPTIONS, $services->getMainConfig()));}, 'Translate:MessageGroupSubscriptionHookHandler'=> static function(MediaWikiServices $services):MessageGroupSubscriptionHookHandler { return new MessageGroupSubscriptionHookHandler($services->get( 'Translate:MessageGroupSubscription'), $services->getUserFactory());}, 'Translate:MessageGroupSubscriptionStore'=> static function(MediaWikiServices $services):MessageGroupSubscriptionStore { return new MessageGroupSubscriptionStore( $services->getConnectionProvider());}, 'Translate:MessageIndex'=> static function(MediaWikiServices $services):MessageIndex { $params=(array) $services->getMainConfig() ->get( 'TranslateMessageIndex');$class=array_shift( $params);$implementationMap=['HashMessageIndex'=> HashMessageIndex::class, 'CDBMessageIndex'=> CDBMessageIndex::class, 'DatabaseMessageIndex'=> DatabaseMessageIndex::class, 'hash'=> HashMessageIndex::class, 'cdb'=> CDBMessageIndex::class, 'database'=> DatabaseMessageIndex::class,];$messageIndexStoreClass=$implementationMap[$class] ?? $implementationMap['database'];return new MessageIndex(new $messageIndexStoreClass, $services->getMainWANObjectCache(), $services->getJobQueueGroup(), $services->get( 'Translate:HookRunner'), LoggerFactory::getInstance(LogNames::MAIN), $services->getMainObjectStash(), $services->getConnectionProvider(), new ServiceOptions(MessageIndex::SERVICE_OPTIONS, $services->getMainConfig()),);}, 'Translate:MessagePrefixStats'=> static function(MediaWikiServices $services):MessagePrefixStats { return new MessagePrefixStats( $services->getTitleParser());}, 'Translate:ParsingPlaceholderFactory'=> static function():ParsingPlaceholderFactory { return new ParsingPlaceholderFactory();}, 'Translate:PersistentCache'=> static function(MediaWikiServices $services):PersistentCache { return new PersistentDatabaseCache($services->getConnectionProvider(), $services->getJsonCodec());}, 'Translate:ProgressStatsTableFactory'=> static function(MediaWikiServices $services):ProgressStatsTableFactory { return new ProgressStatsTableFactory($services->getLinkRenderer(), $services->get( 'Translate:ConfigHelper'), $services->get( 'Translate:MessageGroupMetadata'));}, 'Translate:RevTagStore'=> static function(MediaWikiServices $services):RevTagStore { return new RevTagStore( $services->getConnectionProvider());}, 'Translate:SubpageListBuilder'=> static function(MediaWikiServices $services):SubpageListBuilder { return new SubpageListBuilder($services->get( 'Translate:TranslatableBundleFactory'), $services->getLinkBatchFactory());}, 'Translate:TranslatableBundleDeleter'=> static function(MediaWikiServices $services):TranslatableBundleDeleter { return new TranslatableBundleDeleter($services->getMainObjectStash(), $services->getJobQueueGroup(), $services->get( 'Translate:SubpageListBuilder'), $services->get( 'Translate:TranslatableBundleFactory'));}, 'Translate:TranslatableBundleExporter'=> static function(MediaWikiServices $services):TranslatableBundleExporter { return new TranslatableBundleExporter($services->get( 'Translate:SubpageListBuilder'), $services->getWikiExporterFactory(), $services->getConnectionProvider());}, 'Translate:TranslatableBundleFactory'=> static function(MediaWikiServices $services):TranslatableBundleFactory { return new TranslatableBundleFactory($services->get( 'Translate:TranslatablePageStore'), $services->get( 'Translate:MessageBundleStore'));}, 'Translate:TranslatableBundleImporter'=> static function(MediaWikiServices $services):TranslatableBundleImporter { return new TranslatableBundleImporter($services->getWikiImporterFactory(), $services->get( 'Translate:TranslatablePageParser'), $services->getRevisionLookup(), $services->getNamespaceInfo(), $services->getTitleFactory(), $services->getFormatterFactory());}, 'Translate:TranslatableBundleMover'=> static function(MediaWikiServices $services):TranslatableBundleMover { return new TranslatableBundleMover($services->getMovePageFactory(), $services->getJobQueueGroup(), $services->getLinkBatchFactory(), $services->get( 'Translate:TranslatableBundleFactory'), $services->get( 'Translate:SubpageListBuilder'), $services->getConnectionProvider(), $services->getObjectCacheFactory(), $services->getMainConfig() ->get( 'TranslatePageMoveLimit'));}, 'Translate:TranslatableBundleStatusStore'=> static function(MediaWikiServices $services):TranslatableBundleStatusStore { return new TranslatableBundleStatusStore($services->getConnectionProvider() ->getPrimaryDatabase(), $services->getCollationFactory() ->makeCollation( 'uca-default-u-kn'), $services->getDBLoadBalancer() ->getMaintenanceConnectionRef(DB_PRIMARY));}, 'Translate:TranslatablePageMarker'=> static function(MediaWikiServices $services):TranslatablePageMarker { return new TranslatablePageMarker($services->getConnectionProvider(), $services->getJobQueueGroup(), $services->getLinkRenderer(), MessageGroups::singleton(), $services->get( 'Translate:MessageIndex'), $services->getTitleFormatter(), $services->getTitleParser(), $services->get( 'Translate:TranslatablePageParser'), $services->get( 'Translate:TranslatablePageStore'), $services->get( 'Translate:TranslatablePageStateStore'), $services->get( 'Translate:TranslationUnitStoreFactory'), $services->get( 'Translate:MessageGroupMetadata'), $services->getWikiPageFactory(), $services->get( 'Translate:TranslatablePageView'), $services->get( 'Translate:MessageGroupSubscription'), $services->getFormatterFactory());}, 'Translate:TranslatablePageMessageGroupFactory'=> static function(MediaWikiServices $services):TranslatablePageMessageGroupFactory { return new TranslatablePageMessageGroupFactory(new ServiceOptions(TranslatablePageMessageGroupFactory::SERVICE_OPTIONS, $services->getMainConfig()),);}, 'Translate:TranslatablePageParser'=> static function(MediaWikiServices $services):TranslatablePageParser { return new TranslatablePageParser($services->get( 'Translate:ParsingPlaceholderFactory'));}, 'Translate:TranslatablePageStateStore'=> static function(MediaWikiServices $services):TranslatablePageStateStore { return new TranslatablePageStateStore($services->get( 'Translate:PersistentCache'), $services->getPageStore());}, 'Translate:TranslatablePageStore'=> static function(MediaWikiServices $services):TranslatablePageStore { return new TranslatablePageStore($services->get( 'Translate:MessageIndex'), $services->getJobQueueGroup(), $services->get( 'Translate:RevTagStore'), $services->getConnectionProvider(), $services->get( 'Translate:TranslatableBundleStatusStore'), $services->get( 'Translate:TranslatablePageParser'), $services->get( 'Translate:MessageGroupMetadata'));}, 'Translate:TranslatablePageView'=> static function(MediaWikiServices $services):TranslatablePageView { return new TranslatablePageView($services->getConnectionProvider(), $services->get( 'Translate:TranslatablePageStateStore'), new ServiceOptions(TranslatablePageView::SERVICE_OPTIONS, $services->getMainConfig()));}, 'Translate:TranslateSandbox'=> static function(MediaWikiServices $services):TranslateSandbox { return new TranslateSandbox($services->getUserFactory(), $services->getConnectionProvider(), $services->getPermissionManager(), $services->getAuthManager(), $services->getUserGroupManager(), $services->getActorStore(), $services->getUserOptionsManager(), $services->getJobQueueGroup(), $services->get( 'Translate:HookRunner'), new ServiceOptions(TranslateSandbox::CONSTRUCTOR_OPTIONS, $services->getMainConfig()));}, 'Translate:TranslationStashReader'=> static function(MediaWikiServices $services):TranslationStashReader { return new TranslationStashStorage( $services->getConnectionProvider() ->getPrimaryDatabase());}, 'Translate:TranslationStatsDataProvider'=> static function(MediaWikiServices $services):TranslationStatsDataProvider { return new TranslationStatsDataProvider(new ServiceOptions(TranslationStatsDataProvider::CONSTRUCTOR_OPTIONS, $services->getMainConfig()), $services->getObjectFactory(), $services->getConnectionProvider());}, 'Translate:TranslationUnitStoreFactory'=> static function(MediaWikiServices $services):TranslationUnitStoreFactory { return new TranslationUnitStoreFactory( $services->getDBLoadBalancer());}, 'Translate:TranslatorActivity'=> static function(MediaWikiServices $services):TranslatorActivity { $query=new TranslatorActivityQuery($services->getMainConfig(), $services->getDBLoadBalancer());return new TranslatorActivity($services->getMainObjectStash(), $query, $services->getJobQueueGroup());}, 'Translate:TtmServerFactory'=> static function(MediaWikiServices $services):TtmServerFactory { $config=$services->getMainConfig();$default=$config->get( 'TranslateTranslationDefaultService');if( $default===false) { $default=null;} return new TtmServerFactory( $config->get( 'TranslateTranslationServices'), $default);}]
@phpcs-require-sorted-array