* (bug 5852) Localise "number of watching users" according to user locale
authorRob Church <robchurch@users.mediawiki.org>
Sat, 24 Jun 2006 21:43:34 +0000 (21:43 +0000)
committerRob Church <robchurch@users.mediawiki.org>
Sat, 24 Jun 2006 21:43:34 +0000 (21:43 +0000)
RELEASE-NOTES
includes/ChangesList.php

index 9e37d62..f2e313c 100644 (file)
@@ -560,6 +560,7 @@ Some default configuration options have changed:
 * (bug 5903) When requesting the raw source of a non-existent message page,
   return blank content (as opposed to the message key)
 * Improve default blank content of MediaWiki:Common.css and MediaWiki:Monobook.css
+* (bug 5852) Localise "number of watching users" according to user locale
 
 == Compatibility ==
 
index b2c1abe..8e3b607 100644 (file)
@@ -213,6 +213,16 @@ class ChangesList {
                return( $wgUseRCPatrol && $wgUser->isAllowed( 'patrol' ) );
        }
 
+       /**
+        * Format a number according to the user's locale
+        *
+        * @param $number Number to format
+        * @return string
+        */
+       function formatNum( $number ) {
+               global $wgLang;
+               return $wgLang->formatNum( $number );
+       }
 
 }
 
@@ -225,7 +235,6 @@ class OldChangesList extends ChangesList {
         * Format a line using the old system (aka without any javascript).
         */
        function recentChangesLine( &$rc, $watched = false ) {
-               global $wgContLang;
 
                $fname = 'ChangesList::recentChangesLineOld';
                wfProfileIn( $fname );
@@ -268,7 +277,7 @@ class OldChangesList extends ChangesList {
                $this->insertComment($s, $rc);
 
                if($rc->numberofWatchingusers > 0) {
-                       $s .= ' ' . wfMsg('number_of_watching_users_RCview',  $wgContLang->formatNum($rc->numberofWatchingusers));
+                       $s .= ' ' . wfMsg('number_of_watching_users_RCview', $this->formatNum( $rc->numberofWatchingusers ) );
                }
 
                $s .= "</li>\n";
@@ -473,8 +482,7 @@ class EnhancedChangesList extends ChangesList {
                $r .= $users;
 
                if($block[0]->numberofWatchingusers > 0) {
-                       global $wgContLang;
-                       $r .= wfMsg('number_of_watching_users_RCview',  $wgContLang->formatNum($block[0]->numberofWatchingusers));
+                       $r .= wfMsg('number_of_watching_users_RCview',  $this->formatNum($block[0]->numberofWatchingusers));
                }
                $r .= "<br />\n";
 
@@ -575,7 +583,6 @@ class EnhancedChangesList extends ChangesList {
         * @return string a HTML formated line (generated using $r)
         */
        function recentChangesBlockLine( $rcObj ) {
-               global $wgContLang;
 
                # Get rc_xxxx variables
                extract( $rcObj->mAttribs );
@@ -614,7 +621,7 @@ class EnhancedChangesList extends ChangesList {
                }
 
                if( $rcObj->numberofWatchingusers > 0 ) {
-                       $r .= wfMsg('number_of_watching_users_RCview', $wgContLang->formatNum($rcObj->numberofWatchingusers));
+                       $r .= wfMsg('number_of_watching_users_RCview', $this->formatNum( $rcObj->numberofWatchingusers ) );
                }
 
                $r .= "<br />\n";