Translate extension for MediaWiki
 
Loading...
Searching...
No Matches
MessageGroupStatsTableFactory.php
1<?php
2declare( strict_types = 1 );
3
4namespace MediaWiki\Extension\Translate\Statistics;
5
6use MediaWiki\Context\IContextSource;
9use MediaWiki\Linker\LinkRenderer;
10
18 private ProgressStatsTableFactory $progressStatsTableFactory;
19 private LinkRenderer $linkRenderer;
20 private MessageGroupReviewStore $groupReviewStore;
21 private MessageGroupMetadata $messageGroupMetadata;
22 private bool $haveTranslateWorkflowStates;
23
24 public function __construct(
25 ProgressStatsTableFactory $progressStatsTableFactory,
26 LinkRenderer $linkRenderer,
27 MessageGroupReviewStore $groupReviewStore,
28 MessageGroupMetadata $messageGroupMetadata,
29 bool $haveTranslateWorkflowStates
30 ) {
31 $this->progressStatsTableFactory = $progressStatsTableFactory;
32 $this->linkRenderer = $linkRenderer;
33 $this->groupReviewStore = $groupReviewStore;
34 $this->messageGroupMetadata = $messageGroupMetadata;
35 $this->haveTranslateWorkflowStates = $haveTranslateWorkflowStates;
36 }
37
38 public function newFromContext( IContextSource $contextSource ): MessageGroupStatsTable {
39 return new MessageGroupStatsTable(
40 $this->progressStatsTableFactory->newFromContext( $contextSource ),
41 $this->linkRenderer,
42 $contextSource,
43 $contextSource->getLanguage(),
44 $this->groupReviewStore,
45 $this->messageGroupMetadata,
46 $this->haveTranslateWorkflowStates
47 );
48 }
49}
Provides methods to get and change the state of a message group.
Offers functionality for reading and updating Translate group related metadata.
Used to build the table displayed on Special:MessageGroupStats.