34 private array $options = [];
35 private Language $contentLanguage;
36 private LanguageFactory $languageFactory;
37 private LanguageNameUtils $languageNameUtils;
39 private LoggerInterface $logger;
40 private bool $isMessageGroupSubscriptionEnabled;
42 public function __construct(
43 Language $contentLanguage,
44 LanguageFactory $languageFactory,
45 LanguageNameUtils $languageNameUtils,
49 parent::__construct(
'Translate' );
50 $this->contentLanguage = $contentLanguage;
51 $this->languageFactory = $languageFactory;
52 $this->languageNameUtils = $languageNameUtils;
53 $this->hookRunner = $hookRunner;
55 $this->isMessageGroupSubscriptionEnabled = $config->get(
'TranslateEnableMessageGroupSubscription' );
58 public function doesWrites() {
62 protected function getGroupName() {
68 $out = $this->getOutput();
69 $out->addModuleStyles( [
70 'ext.translate.special.translate.styles',
72 'mediawiki.ui.button',
73 "mediawiki.codex.messagebox.styles",
78 $this->setup( $parameters );
81 if ( $this->getRequest()->getText(
'taction' ) ===
'export' ) {
82 $exportPage = SpecialPage::getTitleFor(
'ExportTranslations' );
83 $out->redirect( $exportPage->getLocalURL( $this->options ) );
86 $out->addModules(
'ext.translate.special.translate' );
87 $out->addJsConfigVars( [
88 'wgTranslateLanguages' => Utilities::getLanguageNames( LanguageNameUtils::AUTONYMS ),
89 'wgTranslateEnableMessageGroupSubscription' => $this->isMessageGroupSubscriptionEnabled
92 $out->addHTML( Html::openElement(
'div', [
94 'class' =>
'grid ext-translate-container notheme skin-invert',
97 $out->addHTML( $this->tuxSettingsForm() );
98 $out->addHTML( $this->messageSelector() );
100 $table =
new MessageTable( $this->getContext(), $this->group, $this->options[
'language'] );
101 $output = $table->fullTable();
103 $out->addHTML( $output );
104 $out->addHTML( Html::closeElement(
'div' ) );
107 private function setup( ?
string $parameters ): void {
108 $request = $this->getRequest();
111 'language' => $this->getLanguage()->getCode(),
112 'group' =>
'!additions',
117 $parameters = array_map(
'trim', explode(
';', (
string)$parameters ) );
119 foreach ( $parameters as $_ ) {
124 if ( str_contains( $_,
'=' ) ) {
125 [ $key, $value ] = array_map(
'trim', explode(
'=', $_, 2 ) );
131 if ( isset( $defaults[$key] ) ) {
132 $nonDefaults[$key] = $value;
136 foreach ( array_keys( $defaults ) as $key ) {
137 $value = $request->getVal( $key );
138 if ( is_string( $value ) ) {
139 $nonDefaults[$key] = $value;
143 $this->hookRunner->onTranslateGetSpecialTranslateOptions( $defaults, $nonDefaults );
145 $this->options = $nonDefaults + $defaults;
146 $this->group = MessageGroups::getGroup( $this->options[
'group'] );
147 if ( $this->group ) {
148 $this->options[
'group'] = $this->group->getId();
150 $this->group = MessageGroups::getGroup( $defaults[
'group'] );
152 isset( $nonDefaults[
'group'] ) &&
153 str_starts_with( $nonDefaults[
'group'],
'page-' ) &&
154 !str_contains( $nonDefaults[
'group'],
'+' )
157 $this->logger->debug(
158 "[Special:Translate] Requested group {groupId} doesn't exist.",
159 [
'groupId' => $nonDefaults[
'group'] ]
164 if ( !$this->languageNameUtils->isKnownLanguageTag( $this->options[
'language'] ) ) {
165 $this->options[
'language'] = $defaults[
'language'];
168 if ( MessageGroups::isDynamic( $this->group ) ) {
170 $this->group->setLanguage( $this->options[
'language'] );
174 private function tuxSettingsForm(): string {
175 $noJs = Html::errorBox(
176 $this->msg(
'tux-nojs' )->escaped(),
181 $attrs = [
'class' =>
'row tux-editor-header' ];
182 $selectors = $this->tuxGroupSelector() .
183 $this->tuxLanguageSelector() .
184 $this->tuxGroupSubscription() .
185 $this->tuxGroupDescription() .
186 $this->tuxWorkflowSelector() .
187 $this->tuxGroupWarning();
189 return Html::rawElement(
'div', $attrs, $selectors ) . $noJs;
192 private function messageSelector(): string {
193 $output = Html::openElement(
'div', [
'class' =>
'row tux-messagetable-header hide' ] );
194 $output .= Html::openElement(
'div', [
'class' =>
'nine columns' ] );
195 $output .= Html::openElement(
'ul', [
'class' =>
'row tux-message-selector' ] );
196 $userId = $this->getUser()->getId();
199 'untranslated' =>
'!translated',
200 'outdated' =>
'fuzzy',
201 'translated' =>
'translated',
202 'unproofread' =>
"translated|!reviewer:$userId|!last-translator:$userId",
205 foreach ( $tabs as $tab => $filter ) {
212 $tabClass =
"tux-tab-$tab";
213 $link = Html::element(
'a', [
'href' =>
'#' ], $this->msg( $tabClass )->text() );
214 $output .= Html::rawElement(
'li', [
215 'class' =>
'column ' . $tabClass,
216 'data-filter' => $filter,
217 'data-title' => $tab,
222 $container = Html::openElement(
'ul', [
'class' =>
'column tux-message-selector' ] );
223 $container .= Html::rawElement(
'li',
224 [
'class' =>
'column' ],
225 Html::element(
'input', [
226 'type' =>
'checkbox',
'name' =>
'optional',
'value' =>
'1',
228 'id' =>
'tux-option-optional',
229 'data-filter' =>
'optional'
230 ] ) .
"\u{00A0}" . Html::label(
231 $this->msg(
'tux-message-filter-optional-messages-label' )->text(),
232 'tux-option-optional'
236 $container .= Html::closeElement(
'ul' );
237 $output .= Html::openElement(
'li', [
'class' =>
'column more' ] ) .
238 $this->msg(
'ellipsis' )->escaped() .
240 Html::closeElement(
'li' );
242 $output .= Html::closeElement(
'ul' );
243 $output .= Html::closeElement(
'div' );
244 $output .= Html::openElement(
'div', [
'class' =>
'three columns' ] );
245 $output .= Html::rawElement(
247 [
'class' =>
'tux-message-filter-wrapper' ],
248 Html::element(
'input', [
249 'class' =>
'tux-message-filter-box',
251 'placeholder' => $this->msg(
'tux-message-filter-placeholder' )->text()
256 $output .= Html::closeElement(
'div' ) . Html::closeElement(
'div' );
261 private function tuxGroupSelector(): string {
262 $groupClass = [
'grouptitle',
'grouplink' ];
263 $subGroupCount =
null;
265 $groupClass[] =
'tux-breadcrumb__item--aggregate';
266 $subGroupCount = count( $this->group->getGroups() );
270 return Html::openElement(
'div', [
271 'class' =>
'eight columns tux-breadcrumb',
272 'data-language' => $this->options[
'language'],
274 Html::element(
'span',
275 [
'class' =>
'grouptitle grouplink tux-breadcrumb__item--aggregate' ],
276 $this->msg(
'translate-msggroupselector-search-all' )->text()
278 Html::element(
'span',
280 'class' => $groupClass,
281 'data-msggroupid' => $this->group->getId(),
282 'data-msggroup-subgroup-count' => $subGroupCount
284 $this->group->getLabel( $this->getContext() )
286 Html::closeElement(
'div' );
289 private function tuxLanguageSelector(): string {
290 if ( $this->options[
'language'] === $this->getConfig()->get(
'TranslateDocumentationLanguageCode' ) ) {
291 $targetLangName = $this->msg(
'translate-documentation-language' )->text();
292 $targetLanguage = $this->contentLanguage;
294 $targetLangName = $this->languageNameUtils->getLanguageName( $this->options[
'language'] );
295 $targetLanguage = $this->languageFactory->getLanguage( $this->options[
'language'] );
298 $label = Html::element(
'span', [], $this->msg(
'tux-languageselector' )->text() );
300 $languageIcon = Html::element(
302 [
'class' =>
'ext-translate-language-icon' ]
305 $targetLanguageName = Html::element(
308 'class' =>
'ext-translate-target-language',
309 'dir' => $targetLanguage->getDir(),
310 'lang' => $targetLanguage->getHtmlCode()
315 $expandIcon = Html::element(
317 [
'class' =>
'ext-translate-language-selector-expand' ]
320 $value = Html::rawElement(
323 'class' =>
'uls mw-ui-button',
325 'title' => $this->msg(
'tux-select-target-language' )->text()
327 $languageIcon . $targetLanguageName . $expandIcon
330 return Html::rawElement(
332 [
'class' =>
'four columns ext-translate-language-selector' ],
337 private function tuxGroupSubscription(): string {
340 [
'class' =>
'twelve columns tux-watch-group' ]
344 private function tuxGroupDescription(): string {
348 [
'class' =>
'twelve columns description' ],
349 $this->getGroupDescription( $this->group )
353 private function getGroupDescription(
MessageGroup $group ): string {
354 $description = $group->getDescription( $this->getContext() );
355 return $description ===
null ?
356 '' : $this->getOutput()->parseAsInterface( $description );
359 private function tuxGroupWarning(): string {
360 if ( $this->options[
'group'] ===
'' ) {
361 return Html::warningBox(
362 $this->msg(
'tux-translate-page-no-such-group' )->parse(),
363 'tux-group-warning twelve column'
370 private function tuxWorkflowSelector(): string {
371 return Html::element(
'div', [
'class' =>
'tux-workflow twelve columns' ] );
378 public static function tabify( Skin $skin, array &$tabs ): bool {
379 $title = $skin->getTitle();
380 if ( !$title->isSpecialPage() ) {
383 [ $alias, $sub ] = MediaWikiServices::getInstance()
384 ->getSpecialPageFactory()->resolveAlias( $title->getText() );
386 $pagesInGroup = [
'Translate',
'LanguageStats',
'MessageGroupStats',
'ExportTranslations' ];
387 if ( !in_array( $alias, $pagesInGroup,
true ) ) {
393 if ( $sub !==
null && trim( $sub ) !==
'' ) {
394 if ( $alias ===
'Translate' || $alias ===
'MessageGroupStats' ) {
395 $params[
'group'] = $sub;
396 } elseif ( $alias ===
'LanguageStats' ) {
398 $params[
'language'] = $sub;
402 $request = $skin->getRequest();
404 $params[
'language'] = $request->getRawVal(
'language' ) ??
'';
405 $params[
'group'] = $request->getRawVal(
'group' ) ??
'';
408 $params = array_filter( $params,
static function (
string $param ) {
409 return $param !==
'';
412 $translate = SpecialPage::getTitleFor(
'Translate' );
413 $languageStatistics = SpecialPage::getTitleFor(
'LanguageStats' );
414 $messageGroupStatistics = SpecialPage::getTitleFor(
'MessageGroupStats' );
417 $tabs[
'namespaces'] = [];
419 $tabs[
'namespaces'][
'translate'] = [
420 'text' => wfMessage(
'translate-taction-translate' )->text(),
421 'href' => $translate->getLocalURL( $params ),
422 'class' =>
'tux-tab',
425 if ( $alias ===
'Translate' ) {
426 $tabs[
'namespaces'][
'translate'][
'class'] .=
' selected';
429 $tabs[
'views'][
'lstats'] = [
430 'text' => wfMessage(
'translate-taction-lstats' )->text(),
431 'href' => $languageStatistics->getLocalURL( $params ),
432 'class' =>
'tux-tab',
434 if ( $alias ===
'LanguageStats' ) {
435 $tabs[
'views'][
'lstats'][
'class'] .=
' selected';
438 $tabs[
'views'][
'mstats'] = [
439 'text' => wfMessage(
'translate-taction-mstats' )->text(),
440 'href' => $messageGroupStatistics->getLocalURL( $params ),
441 'class' =>
'tux-tab',
444 if ( $alias ===
'MessageGroupStats' ) {
445 $tabs[
'views'][
'mstats'][
'class'] .=
' selected';
448 $tabs[
'views'][
'export'] = [
449 'text' => wfMessage(
'translate-taction-export' )->text(),
450 'href' => SpecialPage::getTitleFor(
'ExportTranslations' )->getLocalURL( $params ),
451 'class' =>
'tux-tab',
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