From 4aa172290f1558e0e1a4b80d9c6494c27a0d92db Mon Sep 17 00:00:00 2001 From: Victor Vasiliev Date: Sun, 28 Sep 2008 20:35:58 +0000 Subject: [PATCH] Split time and date in messages. --- includes/Title.php | 23 +++++++++++-------- .../specials/SpecialListUserRestrictions.php | 2 +- languages/messages/MessagesEn.php | 22 +++++++++++++++--- 3 files changed, 34 insertions(+), 13 deletions(-) diff --git a/includes/Title.php b/includes/Title.php index 0bef7bc4d0..c328d88950 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -1327,17 +1327,22 @@ class Title { if( !$r ) $r = $user->getRestrictionForNamespace( $this->getNamespace() ); if( $r ) { - $start = $wgLang->timeanddate( $r->getTimestamp() ); - $end = $r->getExpiry() == 'infinity' ? - wfMsg( 'ipbinfinite' ) : - $wgLang->timeanddate( $r->getExpiry() ); + $error = array(); + $start = array( $wgLang->date( $r->getTimestamp() ), $wgLang->time( $r->getTimestamp() ) ); if( $r->isPage() ) - $errors[] = array( 'userrestricted-page', $this->getFullText(), - $r->getBlockerText(), $r->getReason(), $start, $end ); - elseif( $r->isNamespace() ) { - $errors[] = array( 'userrestricted-namespace', $wgLang->getDisplayNsText( $this->getNamespace() ), - $r->getBlockerText(), $r->getReason(), $start, $end ); + $error = array( 'userrestricted-page', $this->getFullText(), + $r->getBlockerText(), $r->getReason(), $start[0], $start[1] ); + elseif( $r->isNamespace() ) + $error = array( 'userrestricted-namespace', $wgLang->getDisplayNsText( $this->getNamespace() ), + $r->getBlockerText(), $r->getReason(), $start[0], $start[1] ); + + if( $r->getExpiry() == 'infinity' ) { + $error[0] .= '-indef'; + } else { + $error[] = $wgLang->date( $r->getExpiry() ); + $error[] = $wgLang->time( $r->getExpiry() ); } + $errors[] = $error; } } diff --git a/includes/specials/SpecialListUserRestrictions.php b/includes/specials/SpecialListUserRestrictions.php index 908bdc1a9e..a4251b2230 100644 --- a/includes/specials/SpecialListUserRestrictions.php +++ b/includes/specials/SpecialListUserRestrictions.php @@ -134,7 +134,7 @@ class UserRestrictionsPager extends ReverseChronologicalPager { $subjlink = $sk->userLink( $r->getSubjectId(), $r->getSubjectText() ) . $sk->userToolLinks( $r->getSubjectId(), $r->getSubjectText() ); $expiry = is_numeric( $r->getExpiry() ) ? - wfMsg( 'listuserrestrictions-row-expiry', $wgLang->timeanddate( $r->getExpiry() ) ) : + wfMsg( 'listuserrestrictions-row-expiry', $wgLang->date( $r->getExpiry() ), $wgLang->time( $r->getExpiry() ) ) : wfMsg( 'ipbinfinite' ); $msg = ''; if( $r->isNamespace() ) { diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 22240f0472..dad954ce42 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -1205,7 +1205,7 @@ It already exists.', The restriction was put by [[User:$2|$2]]. The reason given is \'\'$3\'\'. -Restriction was put at $4 and expires at $5. +Restriction was put on $4 at $5 and expires on $6 at $7. You can contact [[User:$2|$2]] or another [[{{MediaWiki:Grouppage-sysop}}|administrator]] to discuss the restriction.', 'userrestricted-namespace' => "'''Your user name or IP address has been restricted from editing $1 namespace.''' @@ -1213,7 +1213,23 @@ You can contact [[User:$2|$2]] or another [[{{MediaWiki:Grouppage-sysop}}|admini The restriction was put by [[User:$2|$2]]. The reason given is ''$3''. -Restriction was put at $4 and expires at $5. +Restriction was put on $4 at $5 and expires on $6 at $7. + +You can contact [[User:$2|$2]] or another [[{{MediaWiki:Grouppage-sysop}}|administrator]] to discuss the restriction.", +'userrestricted-page-indef' => '\'\'\'Your user name or IP address has been restricted from editing page "$1".\'\'\' + +The restriction was put by [[User:$2|$2]]. +The reason given is \'\'$3\'\'. + +Restriction was put at $4 and will not expire. + +You can contact [[User:$2|$2]] or another [[{{MediaWiki:Grouppage-sysop}}|administrator]] to discuss the restriction.', +'userrestricted-namespace-indef' => "'''Your user name or IP address has been restricted from editing $1 namespace.''' + +The restriction was put by [[User:$2|$2]]. +The reason given is ''$3''. + +Restriction was put at $4 and will not expire. You can contact [[User:$2|$2]] or another [[{{MediaWiki:Grouppage-sysop}}|administrator]] to discuss the restriction.", @@ -2596,7 +2612,7 @@ You cannot create an account', [[Special:Ipblocklist|Blocks]] are not listed here.', 'listuserrestrictions-row-ns' => 'restricted $1 from editing $2 namespace ($3)', 'listuserrestrictions-row-page' => 'restricted $1 from editing $2 ($3)', -'listuserrestrictions-row-expiry' => 'expires at $1', +'listuserrestrictions-row-expiry' => 'expires on $1 at $2', 'listuserrestrictions-legend' => 'Find a restriction', 'listuserrestrictions-type' => 'Type:', 'listuserrestrictions-user' => 'User:', -- 2.20.1