18 protected function getMessageParameters(): array {
19 $params = parent::getMessageParameters();
20 $legacy = $this->entry->getParameters();
22 $type = $this->entry->getFullType();
24 case 'pagetranslation/mark':
25 $revision = $legacy[
'revision'];
27 $targetPage = $this->makePageLink(
28 $this->entry->getTarget(),
29 [
'oldid' => $revision ]
32 $params[2] = Message::rawParam( $targetPage );
35 case 'pagetranslation/moveok':
36 case 'pagetranslation/movenok':
37 case 'pagetranslation/deletefnok':
38 case 'pagetranslation/deletelnok':
39 case 'messagebundle/moveok':
40 case 'messagebundle/movenok':
41 $target = $legacy[
'target'] ??
'Special:Badtitle';
42 $moveTarget = $this->makePageLink( Title::newFromText( $target ) );
43 $params[3] = Message::rawParam( $moveTarget );
46 case 'pagetranslation/prioritylanguages':
47 $params[3] = $legacy[
'force'];
48 $languages = $legacy[
'languages'];
49 if ( $languages !==
false ) {
50 $lang = $this->context->getLanguage();
51 $inLanguage = $lang->getCode();
53 $languages = array_map(
54 static function (
string $code ) use ( $inLanguage ):
string {
55 return Utilities::getLanguageName( trim( $code ), $inLanguage );
57 preg_split(
'/,/', $languages, -1, PREG_SPLIT_NO_EMPTY )
60 $params[4] = $lang->listToText( $languages );
64 case 'pagetranslation/associate':
65 case 'pagetranslation/dissociate':
66 $params[3] = $legacy[
'aggregategroup'];
73 public function getComment():
string {
74 $legacy = $this->entry->getParameters();
75 if ( isset( $legacy[
'reason'] ) ) {
76 $commentFormatter = MediaWikiServices::getInstance()->getCommentFormatter();
77 $comment = $commentFormatter->formatBlock( (
string)$legacy[
'reason'] );
80 return ltrim( $comment );
83 return parent::getComment();
86 protected function getMessageKey():
string {
87 $key = parent::getMessageKey();
88 $type = $this->entry->getFullType();
92 if ( $type ===
'pagetranslation/prioritylanguages' ) {
93 $params = $this->getMessageParameters();
94 if ( !isset( $params[4] ) ) {
96 } elseif ( $params[
'3'] ===
'on' ) {