From 9ac82242a5f40f96f1681b2d605b8fd7b4f61a0c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bartosz=20Dziewo=C5=84ski?= Date: Wed, 10 Jan 2018 23:12:18 +0100 Subject: [PATCH] SpecialProtectedtitles: Use 'comma-separator' instead of hardcoded comma Also simplify the code. Change-Id: Ib3914b618ba3a7f1fd3e9df5527653a28c3e4ef9 --- includes/specials/SpecialProtectedtitles.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/includes/specials/SpecialProtectedtitles.php b/includes/specials/SpecialProtectedtitles.php index fa9033cb31..af2b81f152 100644 --- a/includes/specials/SpecialProtectedtitles.php +++ b/includes/specials/SpecialProtectedtitles.php @@ -85,10 +85,8 @@ class SpecialProtectedtitles extends SpecialPage { } $link = $this->getLinkRenderer()->makeLink( $title ); - $description_items = []; // Messages: restriction-level-sysop, restriction-level-autoconfirmed - $protType = $this->msg( 'restriction-level-' . $row->pt_create_perm )->escaped(); - $description_items[] = $protType; + $description = $this->msg( 'restriction-level-' . $row->pt_create_perm )->escaped(); $lang = $this->getLanguage(); $expiry = strlen( $row->pt_expiry ) ? $lang->formatExpiry( $row->pt_expiry, TS_MW ) : @@ -96,7 +94,7 @@ class SpecialProtectedtitles extends SpecialPage { if ( $expiry !== 'infinity' ) { $user = $this->getUser(); - $description_items[] = $this->msg( + $description .= $this->msg( 'comma-separator' )->escaped() . $this->msg( 'protect-expiring-local', $lang->userTimeAndDate( $expiry, $user ), $lang->userDate( $expiry, $user ), @@ -104,8 +102,7 @@ class SpecialProtectedtitles extends SpecialPage { )->escaped(); } - // @todo i18n: This should use a comma separator instead of a hard coded comma, right? - return '
  • ' . $lang->specialList( $link, implode( $description_items, ', ' ) ) . "
  • \n"; + return '
  • ' . $lang->specialList( $link, $description ) . "
  • \n"; } /** -- 2.20.1