* (bug 11809) Use formatNum() for more numbers
authorRaimond Spekking <raymond@users.mediawiki.org>
Tue, 30 Oct 2007 11:57:39 +0000 (11:57 +0000)
committerRaimond Spekking <raymond@users.mediawiki.org>
Tue, 30 Oct 2007 11:57:39 +0000 (11:57 +0000)
Based on a patch of Roozbeh Pournader

RELEASE-NOTES
includes/ImagePage.php
includes/Pager.php
includes/Skin.php
includes/media/Generic.php

index 99ea5fd..cc31c80 100644 (file)
@@ -123,6 +123,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 11762) Fix native language name of Akan (ak)
 * (bug 11722) Fix inconsistent case in unprotect tabs
 * (bug 11795) Be more paranoid about confirming accept-encoding header is present
+* (bug 11809) Use formatNum() for more numbers
 
 === API changes in 1.12 ===
 
index a989666..e68fbfa 100644 (file)
@@ -220,7 +220,7 @@ class ImagePage extends Article {
                                        }
                                        $msgbig  = wfMsgHtml( 'show-big-image' );
                                        $msgsmall = wfMsgExt( 'show-big-image-thumb',
-                                               array( 'parseinline' ), $width, $height );
+                                               array( 'parseinline' ), $wgLang->formatNum( $width ), $wgLang->formatNum( $height ) );
                                } else {
                                        # Image is small enough to show full size on image page
                                        $msgbig = htmlspecialchars( $this->img->getName() );
index 70d0873..0d5ca43 100644 (file)
@@ -422,21 +422,21 @@ abstract class AlphabeticPager extends IndexPager {
         */
        function getNavigationBar() {
                global $wgLang;
-               
+
                $linkTexts = array(
-                       'prev' => wfMsgHtml( "prevn", $this->mLimit ),
-                       'next' => wfMsgHtml( 'nextn', $this->mLimit ),
-                       'first' => wfMsgHtml('page_first'), /* Introduced the message */
+                       'prev' => wfMsgHtml( 'prevn', $wgLang->formatNum( $this->mLimit ) ),
+                       'next' => wfMsgHtml( 'nextn', $wgLang->formatNum($this->mLimit ) ),
+                       'first' => wfMsgHtml( 'page_first' ), /* Introduced the message */
                        'last' => wfMsgHtml( 'page_last' )  /* Introduced the message */
                );
-               
+
                $pagingLinks = $this->getPagingLinks( $linkTexts );
                $limitLinks = $this->getLimitLinks();
                $limits = implode( ' | ', $limitLinks );
-               
+
                $this->mNavigationBar = "({$pagingLinks['first']} | {$pagingLinks['last']}) " . wfMsgHtml("viewprevnext", $pagingLinks['prev'], $pagingLinks['next'], $limits);
                return $this->mNavigationBar;
-               
+
        }
 }
 
@@ -458,16 +458,16 @@ abstract class ReverseChronologicalPager extends IndexPager {
                        return $this->mNavigationBar;
                }
                $linkTexts = array(
-                       'prev' => wfMsgHtml( "prevn", $this->mLimit ),
-                       'next' => wfMsgHtml( 'nextn', $this->mLimit ),
-                       'first' => wfMsgHtml('histlast'),
+                       'prev' => wfMsgHtml( 'prevn', $wgLang->formatNum( $this->mLimit ) ),
+                       'next' => wfMsgHtml( 'nextn', $wgLang->formatNum( $this->mLimit ) ),
+                       'first' => wfMsgHtml( 'histlast' ),
                        'last' => wfMsgHtml( 'histfirst' )
                );
 
                $pagingLinks = $this->getPagingLinks( $linkTexts );
                $limitLinks = $this->getLimitLinks();
                $limits = implode( ' | ', $limitLinks );
-               
+
                $this->mNavigationBar = "({$pagingLinks['first']} | {$pagingLinks['last']}) " . 
                        wfMsgHtml("viewprevnext", $pagingLinks['prev'], $pagingLinks['next'], $limits);
                return $this->mNavigationBar;
@@ -712,4 +712,3 @@ abstract class TablePager extends IndexPager {
         */
        abstract function getFieldNames();
 }
-
index 0c5eaa1..f8f641f 100644 (file)
@@ -785,7 +785,7 @@ END;
        }
 
        function getUndeleteLink() {
-               global $wgUser, $wgTitle, $wgContLang, $action;
+               global $wgUser, $wgTitle, $wgContLang, $wgLang, $action;
                if(     $wgUser->isAllowed( 'deletedhistory' ) &&
                        (($wgTitle->getArticleId() == 0) || ($action == "history")) &&
                        ($n = $wgTitle->isDeleted() ) )
@@ -798,7 +798,7 @@ END;
                        return wfMsg( $msg,
                                $this->makeKnownLinkObj(
                                        SpecialPage::getTitleFor( 'Undelete', $wgTitle->getPrefixedDBkey() ),
-                                       wfMsgExt( 'restorelink', array( 'parsemag', 'escape' ), $n ) ) );
+                                       wfMsgExt( 'restorelink', array( 'parsemag', 'escape' ), $wgLang->formatNum( $n ) ) ) );
                }
                return '';
        }
index c7ab7d8..59506f9 100644 (file)
@@ -386,26 +386,24 @@ abstract class ImageHandler extends MediaHandler {
                global $wgLang;
                $nbytes = '(' . wfMsgExt( 'nbytes', array( 'parsemag', 'escape' ),
                        $wgLang->formatNum( $file->getSize() ) ) . ')';
-               $widthheight = wfMsgHtml( 'widthheight', $file->getWidth(), $file->getHeight() );
-               
+               $widthheight = wfMsgHtml( 'widthheight', $wgLang->formatNum( $file->getWidth() ) ,$wgLang->formatNum( $file->getHeight() ) );
+
                return "$widthheight ($nbytes)";
        }
 
        function getLongDesc( $file ) {
                global $wgLang;
-               return wfMsgHtml('file-info-size', $file->getWidth(), $file->getHeight(), 
+               return wfMsgHtml('file-info-size', $wgLang->formatNum( $file->getWidth() ), $wgLang->formatNum( $file->getHeight() ), 
                        $wgLang->formatSize( $file->getSize() ), $file->getMimeType() );
        }
 
        function getDimensionsString( $file ) {
+               global $wgLang;
                $pages = $file->pageCount();
                if ( $pages > 1 ) {
-                       return wfMsg( 'widthheightpage', $file->getWidth(), $file->getHeight(), $pages );
+                       return wfMsg( 'widthheightpage', $wgLang->formatNum( $file->getWidth() ), $wgLang->formatNum( $file->getHeight() ), $wgLang->formatNum( $pages ) );
                } else {
-                       return wfMsg( 'widthheight', $file->getWidth(), $file->getHeight() );
+                       return wfMsg( 'widthheight', $wgLang->formatNum( $file->getWidth() ), $wgLang->formatNum( $file->getHeight() ) );
                }
        }
 }
-
-
-