45 private MessageLocalizer $messageLocalizer;
47 private const MAX_PROCESSING_TIME = 43;
59 MessageLocalizer $messageLocalizer,
63 $this->setTitle( $title );
64 $this->setUser( $user );
66 $this->setCode( $code );
67 $this->messageLocalizer = $messageLocalizer;
75 public function setTitle( Title $title ): void {
76 $this->title = $title;
79 public function getUser(): User {
83 public function setUser( User $user ): void {
94 $this->group = $group;
96 $this->group = MessageGroups::getGroup( $group );
100 public function getCode(): string {
104 public function setCode(
string $code =
'en' ): void {
108 protected function getAction(): string {
109 return $this->getTitle()->getLocalURL();
112 protected function doHeader(): string {
115 'action' => $this->getAction(),
116 'class' =>
'mw-translate-manage'
119 $csrfTokenSet = RequestContext::getMain()->getCsrfTokenSet();
120 return Xml::openElement(
'form', $formParams ) .
121 Html::hidden(
'title', $this->getTitle()->getPrefixedText() ) .
122 Html::hidden(
'token', $csrfTokenSet->getToken() ) .
123 Html::hidden(
'process', 1 );
126 protected function doFooter(): string {
130 protected function allowProcess(): bool {
131 $context = RequestContext::getMain();
132 $request = $context->getRequest();
133 $csrfTokenSet = $context->getCsrfTokenSet();
135 return $request->wasPosted()
136 && $request->getBool(
'process' )
137 && $csrfTokenSet->matchTokenField(
'token' );
140 protected function getActions(): array {
143 $this->code ===
'en' ?
'fuzzy' :
'conflict',
148 public function execute( array $messages ): bool {
149 $context = RequestContext::getMain();
150 $output = $context->getOutput();
153 $diff =
new DifferenceEngine();
154 $diff->showDiffStyle();
155 $diff->setReducedLineNumbers();
158 $process = $this->allowProcess();
161 $group = $this->getGroup();
162 $code = $this->getCode();
163 $collection = $group->initCollection( $code );
164 $collection->loadTranslations();
166 $output->addHTML( $this->doHeader() );
175 foreach ( $messages as $key => $value ) {
177 $isExistingMessageFuzzy =
false;
179 if ( isset( $collection[$key] ) ) {
181 $old = $collection[$key]->translation();
182 $isExistingMessageFuzzy = $collection[$key]->hasTag(
'fuzzy' );
185 if ( $old ===
null ) {
198 $para =
'<code class="mw-tmi-new">' . htmlspecialchars( $key ) .
'</code>';
199 $name = $context->msg(
'translate-manage-import-new' )->rawParams( $para )
201 $text = Utilities::convertWhiteSpaceToHTML( $value );
202 $changed[] = self::makeSectionElement( $name,
'new', $text );
205 if ( $old === (
string)$value ) {
210 $oldTextForDiff = $old;
211 if ( $isExistingMessageFuzzy ) {
212 if ( MessageHandle::makeFuzzyString( $old ) === (
string)$value ) {
218 $oldTextForDiff = MessageHandle::makeFuzzyString( $old );
222 $dummyMainPage = Title::makeTitle( NS_MAIN,
'Some title just for diff' );
223 $oldContent = ContentHandler::makeContent( $oldTextForDiff, $dummyMainPage );
224 $oldRevision =
new MutableRevisionRecord( $dummyMainPage );
225 $oldRevision->setContent( SlotRecord::MAIN, $oldContent );
227 $newContent = ContentHandler::makeContent( $value, $dummyMainPage );
228 $newRevision =
new MutableRevisionRecord( $dummyMainPage );
229 $newRevision->setContent( SlotRecord::MAIN, $newContent );
231 $diff->setRevisions( $oldRevision, $newRevision );
232 $text = $diff->getDiff(
'',
'' );
239 $action = $context->getRequest()
240 ->getVal( self::escapeNameForPHP(
"action-$type-$key" ) );
243 if ( $changed === [] ) {
248 if ( $action ===
null ) {
251 $message = $context->msg(
252 'translate-manage-inconsistent',
253 wfEscapeWikiText(
"action-$type-$key" )
255 $changed[] =
"<li>$message</li></ul>";
261 if ( $this->time ===
null ) {
262 $this->time = (int)wfTimestamp();
267 $messageKeyAndParams = $this->doAction(
275 $msgKey = array_shift( $messageKeyAndParams );
276 $params = $messageKeyAndParams;
277 $message = $context->msg( $msgKey, $params )->parse();
278 $changed[] =
"<li>$message</li>";
282 if ( $this->checkProcessTime() ) {
284 $message = $context->msg(
'translate-manage-toolong' )
285 ->numParams( self::MAX_PROCESSING_TIME )->parse();
286 $changed[] =
"<li>$message</li></ul>";
298 $actions = $this->getActions();
299 $defaultAction = $action ?:
'import';
306 foreach ( $actions as $action ) {
307 $label = $context->msg(
"translate-manage-action-$action" )->escaped();
308 $act[] = Html::rawElement(
312 self::escapeNameForPHP(
"action-$type-$key" ),
313 $action === $defaultAction,
314 [
'value' => $action ]
321 $param =
'<code class="mw-tmi-diff">' . htmlspecialchars( $key ) .
'</code>';
322 $name = $context->msg(
'translate-manage-import-diff' )
323 ->rawParams( $param, implode(
' ', $act ) )
326 $changed[] = self::makeSectionElement( $name, $type, $text );
331 $collection->filter( MessageCollection::FILTER_HAS_TRANSLATION, MessageCollection::INCLUDE_MATCHING );
332 $keys = $collection->getMessageKeys();
334 $diff = array_diff( $keys, array_keys( $messages ) );
336 foreach ( $diff as $s ) {
337 $para =
'<code class="mw-tmi-deleted">' . htmlspecialchars( $s ) .
'</code>';
338 $name = $context->msg(
'translate-manage-import-deleted' )->rawParams( $para )->escaped();
339 $text = Utilities::convertWhiteSpaceToHTML( $collection[$s]->translation() );
340 $changed[] = self::makeSectionElement( $name,
'deleted', $text );
344 if ( $process || ( $changed === [] && $code !==
'en' ) ) {
345 if ( $changed === [] ) {
346 $output->addWikiMsg(
'translate-manage-nochanges-other' );
349 if ( $changed === [] || !str_starts_with( end( $changed ),
'<li>' ) ) {
353 $changed[] =
'</ul>';
355 $languageName = Utilities::getLanguageName( $code, $context->getLanguage()->getCode() );
357 ->msg(
'translate-manage-import-done', $group->getId(), $group->getLabel(), $languageName )
359 $changed[] = Html::successBox( $message );
360 $output->addHTML( implode(
"\n", $changed ) );
363 if ( $changed !== [] ) {
364 if ( $code ===
'en' ) {
365 $output->addWikiMsg(
'translate-manage-intro-en' );
367 $lang = Utilities::getLanguageName(
369 $context->getLanguage()->getCode()
371 $output->addWikiMsg(
'translate-manage-intro-other', $lang );
373 $output->addHTML( Html::hidden(
'language', $code ) );
374 $output->addHTML( implode(
"\n", $changed ) );
375 $output->addHTML( Html::submitButton( $context->msg(
'translate-manage-submit' )->text() ) );
377 $output->addWikiMsg(
'translate-manage-nochanges' );
381 $output->addHTML( $this->doFooter() );
395 private function doAction(
401 global $wgTranslateDocumentationLanguageCode;
404 $code = $this->getCode();
405 $title = $this->makeTranslationTitle( $group, $key, $code );
407 if ( $action ===
'import' || $action ===
'conflict' ) {
408 if ( $action ===
'import' ) {
409 $comment = wfMessage(
'translate-manage-import-summary' )->inContentLanguage()->plain();
411 $comment = wfMessage(
'translate-manage-conflict-summary' )->inContentLanguage()->plain();
412 $message = MessageHandle::makeFuzzyString( $message );
415 return self::doImport( $title, $message, $comment, $this->getUser(), $this->messageLocalizer );
416 } elseif ( $action ===
'ignore' ) {
417 return [
'translate-manage-import-ignore', $key ];
418 } elseif ( $action ===
'fuzzy' && $code !==
'en' &&
419 $code !== $wgTranslateDocumentationLanguageCode
421 $message = MessageHandle::makeFuzzyString( $message );
423 return self::doImport( $title, $message, $comment, $this->getUser(), $this->messageLocalizer );
424 } elseif ( $action ===
'fuzzy' && $code ===
'en' ) {
425 return self::doFuzzy( $title, $message, $comment, $this->getUser(), $this->messageLocalizer );
427 throw new InvalidArgumentException(
"Unhandled action $action" );
431 protected function checkProcessTime() {
432 return (
int)wfTimestamp() - $this->time >= self::MAX_PROCESSING_TIME;
436 private static function doImport(
441 MessageLocalizer $messageLocalizer
443 $mwServices = MediaWikiServices::getInstance();
444 $wikiPage = $mwServices->getWikiPageFactory()->newFromTitle( $title );
445 $content = ContentHandler::makeContent( $message, $title );
447 $updater = $wikiPage->newPageUpdater( $user )->setContent( SlotRecord::MAIN, $content );
448 if ( $user->authorizeWrite(
'autopatrol', $title ) ) {
449 $updater->setRcPatrolStatus( RecentChange::PRC_AUTOPATROLLED );
451 $updater->saveRevision( CommentStoreComment::newUnsavedComment( $summary ) );
452 $status = $updater->getStatus();
453 $success = $status->isOK();
456 return [
'translate-manage-import-ok',
457 wfEscapeWikiText( $title->getPrefixedText() )
461 $statusFormatter = $mwServices
462 ->getFormatterFactory()
463 ->getStatusFormatter( $messageLocalizer );
464 $text =
"Failed to import new version of page {$title->getPrefixedText()}\n";
465 $text .= $statusFormatter->getWikiText( $status );
466 throw new RuntimeException( $text );
475 MessageLocalizer $messageLocalizer
477 $context = RequestContext::getMain();
478 $services = MediaWikiServices::getInstance();
480 if ( !$context->getUser()->isAllowed(
'translate-manage' ) ) {
481 return [
'badaccess-group0' ];
486 $user = FuzzyBot::getUser();
491 $titleText = $handle->getKey();
493 $revStore = $services->getRevisionStore();
494 $dbw = $services->getDBLoadBalancer()->getConnection( DB_PRIMARY );
495 $rows = $revStore->newSelectQueryBuilder( $dbw )
498 'page_namespace' => $title->getNamespace(),
499 'page_latest=rev_id',
500 'page_title' . $dbw->buildLike(
"$titleText/", $dbw->anyString() ),
502 ->caller( __METHOD__ )
506 $slots = $revStore->getContentBlobsForBatch( $rows, [ SlotRecord::MAIN ] )->getValue();
508 foreach ( $rows as $row ) {
509 global $wgTranslateDocumentationLanguageCode;
511 $translationTitle = Title::makeTitle( (
int)$row->page_namespace, $row->page_title );
514 if ( $translationTitle->getSubpageText() ===
'en' ||
515 $translationTitle->getSubpageText() === $wgTranslateDocumentationLanguageCode
519 } elseif ( isset( $slots[$row->rev_id] ) ) {
520 $slot = $slots[$row->rev_id][SlotRecord::MAIN];
521 $text = MessageHandle::makeFuzzyString( $slot->blob_data );
523 $text = MessageHandle::makeFuzzyString(
524 Utilities::getTextFromTextContent(
525 $revStore->newRevisionFromRow( $row )->getContent( SlotRecord::MAIN )
531 $changed[] = self::doImport(
542 foreach ( $changed as $c ) {
543 $key = array_shift( $c );
544 $text .=
'* ' . $context->msg( $key, $c )->plain() .
"\n";
547 return [
'translate-manage-import-fuzzy',
"\n" . $text ];
559 private function makeTranslationTitle(
MessageGroup $group,
string $key,
string $code ): Title {
560 $ns = $group->getNamespace();
562 return Title::makeTitleSafe( $ns,
"$key/$code" );
578 ?Language $lang =
null
580 $containerParams = [
'class' =>
"mw-tpt-sp-section mw-tpt-sp-section-type-{$type}" ];
581 $legendParams = [
'class' =>
'mw-tpt-sp-legend' ];
582 $contentParams = [
'class' =>
'mw-tpt-sp-content' ];
584 $contentParams[
'dir'] = $lang->getDir();
585 $contentParams[
'lang'] = $lang->getCode();
588 return Html::rawElement(
'div', $containerParams,
589 Html::rawElement(
'div', $legendParams, $legend ) .
590 Html::rawElement(
'div', $contentParams, $content )
599 private static function escapeNameForPHP(
string $name ): string {
611 return strtr( $name, $replacements );
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