20 public function getMessageParameters(): array {
21 $params = parent::getMessageParameters();
23 $type = $this->entry->getFullType();
25 if ( $type ===
'translationreview/message' ) {
26 $targetPage = $this->makePageLink(
27 $this->entry->getTarget(),
28 [
'oldid' => $params[3] ]
31 $params[2] = Message::rawParam( $targetPage );
32 } elseif ( $type ===
'translationreview/group' ) {
40 $uiLanguage = $this->context->getLanguage();
41 $language = $params[3];
43 $targetPage = $this->makePageLinkWithText(
44 $this->entry->getTarget(),
46 [
'language' => $language ]
49 $params[2] = Message::rawParam( $targetPage );
50 $params[3] = Utilities::getLanguageName( $language, $uiLanguage->getCode() );
51 $params[5] = $this->formatStateMessage( $params[5] );
52 $params[6] = $this->formatStateMessage( $params[6] );
53 } elseif ( $type ===
'translatorsandbox/rejected' ) {
55 $params[2] = $this->entry->getTarget()->getText();
56 } elseif ( $type ===
'translatorsandbox/promoted' ) {
58 $params[3] = MediaWikiServices::getInstance()->getUserFactory()
59 ->newFromId( $params[3] )
67 private function formatStateMessage( $value ):
string {
68 $message = $this->msg(
"translate-workflow-state-$value" );
70 return $message->isBlank() ? $value : $message->text();
74 private function makePageLinkWithText(
75 ?Title $pageTitle, ?
string $text, array $queryParameters = []
77 if ( !$this->plaintext ) {
78 $link = $this->getLinkRenderer()->makeLink( $pageTitle, $text, [], $queryParameters );
81 if ( $pageTitle instanceof Title ) {
82 $target = $pageTitle->getPrefixedText();
84 $link =
"[[$target|$text]]";