From: Raimond Spekking Date: Tue, 30 Oct 2007 11:57:39 +0000 (+0000) Subject: * (bug 11809) Use formatNum() for more numbers X-Git-Tag: 1.31.0-rc.0~51050 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/password.php?a=commitdiff_plain;h=6235449e09873d8b8e37e8ff5b9e310d71d036ee;p=lhc%2Fweb%2Fwiklou.git * (bug 11809) Use formatNum() for more numbers Based on a patch of Roozbeh Pournader --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 99ea5fd9dd..cc31c80699 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 === diff --git a/includes/ImagePage.php b/includes/ImagePage.php index a9896667b0..e68fbfa8c4 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -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() ); diff --git a/includes/Pager.php b/includes/Pager.php index 70d0873c35..0d5ca43440 100644 --- a/includes/Pager.php +++ b/includes/Pager.php @@ -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(); } - diff --git a/includes/Skin.php b/includes/Skin.php index 0c5eaa1ed6..f8f641fc89 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -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 ''; } diff --git a/includes/media/Generic.php b/includes/media/Generic.php index c7ab7d81db..59506f95ef 100644 --- a/includes/media/Generic.php +++ b/includes/media/Generic.php @@ -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() ) ); } } } - - -