Localisation updates from https://translatewiki.net.
[mediawiki.git] / includes / logging / ContentModelLogFormatter.php
blob3bf724245aa11890c7c84ef80ec0d34ebc6bdae6
1 <?php
3 use MediaWiki\Content\ContentHandler;
4 use MediaWiki\SpecialPage\SpecialPage;
6 class ContentModelLogFormatter extends LogFormatter {
7 protected function getMessageParameters() {
8 $lang = $this->context->getLanguage();
9 $params = parent::getMessageParameters();
10 $params[3] = ContentHandler::getLocalizedName( $params[3], $lang );
11 $params[4] = ContentHandler::getLocalizedName( $params[4], $lang );
12 return $params;
15 public function getActionLinks() {
16 if ( $this->entry->isDeleted( LogPage::DELETED_ACTION ) // Action is hidden
17 || $this->entry->getSubtype() !== 'change'
18 || !$this->context->getAuthority()->isAllowed( 'editcontentmodel' )
19 ) {
20 return '';
23 $params = $this->extractParameters();
24 $revert = $this->getLinkRenderer()->makeKnownLink(
25 SpecialPage::getTitleFor( 'ChangeContentModel' ),
26 $this->msg( 'logentry-contentmodel-change-revertlink' )->text(),
27 [],
29 'pagetitle' => $this->entry->getTarget()->getPrefixedText(),
30 'model' => $params[3],
31 'reason' => $this->msg( 'logentry-contentmodel-change-revert' )->inContentLanguage()->text(),
35 return $this->msg( 'parentheses' )->rawParams( $revert )->escaped();