Split time and date in messages.
authorVictor Vasiliev <vasilievvv@users.mediawiki.org>
Sun, 28 Sep 2008 20:35:58 +0000 (20:35 +0000)
committerVictor Vasiliev <vasilievvv@users.mediawiki.org>
Sun, 28 Sep 2008 20:35:58 +0000 (20:35 +0000)
includes/Title.php
includes/specials/SpecialListUserRestrictions.php
languages/messages/MessagesEn.php

index 0bef7bc..c328d88 100644 (file)
@@ -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;
                        }
                }
 
index 908bdc1..a4251b2 100644 (file)
@@ -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() ) {
index 22240f0..dad954c 100644 (file)
@@ -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'         => "<big>'''Your user name or IP address has been restricted from editing $1 namespace.'''</big>
@@ -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'        => '<big>\'\'\'Your user name or IP address has been restricted from editing page "$1".\'\'\'</big>
+
+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'    => "<big>'''Your user name or IP address has been restricted from editing $1 namespace.'''</big>
+
+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:',