* Support plural in undeleted{revisions,revisions-files,files}
authorNiklas Laxström <nikerabbit@users.mediawiki.org>
Fri, 12 Oct 2007 15:33:58 +0000 (15:33 +0000)
committerNiklas Laxström <nikerabbit@users.mediawiki.org>
Fri, 12 Oct 2007 15:33:58 +0000 (15:33 +0000)
RELEASE-NOTES
includes/GlobalFunctions.php
languages/messages/MessagesEn.php

index 1ad1b68..b4f3d2c 100644 (file)
@@ -101,6 +101,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   email address when registering.
 * (bug 11612) Days to show in recent changes cannot be larger than 7
 * (bug 11131) Change filearchive width/height columns to int for Postgres
+* Support plural in undeleted{revisions,revisions-files,files}
 
 === API changes in 1.12 ===
 
index b216eca..38f0753 100644 (file)
@@ -416,11 +416,10 @@ function wfMsgNoDBForContent( $key ) {
  * @return String: the requested message.
  */
 function wfMsgReal( $key, $args, $useDB = true, $forContent=false, $transform = true ) {
-       $fname = 'wfMsgReal';
-       wfProfileIn( $fname );
+       wfProfileIn( __METHOD__ );
        $message = wfMsgGetKey( $key, $useDB, $forContent, $transform );
        $message = wfMsgReplaceArgs( $message, $args );
-       wfProfileOut( $fname );
+       wfProfileOut( __METHOD__ );
        return $message;
 }
 
@@ -569,6 +568,7 @@ function wfMsgWikiHtml( $key ) {
  *  <i>escape</i>: filters message trough htmlspecialchars
  *  <i>replaceafter</i>: parameters are substituted after parsing or escaping
  *  <i>parsemag</i>: transform the message using magic phrases
+ *  <i>content</i>: fetch message for content language instead of interface
  */
 function wfMsgExt( $key, $options ) {
        global $wgOut, $wgParser;
@@ -581,7 +581,12 @@ function wfMsgExt( $key, $options ) {
                $options = array($options);
        }
 
-       $string = wfMsgGetKey( $key, true, false, false );
+       $forContent = false;
+       if( in_array('content', $options) ) {
+               $forContent = true;
+       }
+
+       $string = wfMsgGetKey( $key, /*DB*/true, $forContent, /*Transform*/false );
 
        if( !in_array('replaceafter', $options) ) {
                $string = wfMsgReplaceArgs( $string, $args );
index c038db2..c13c450 100644 (file)
@@ -1940,9 +1940,9 @@ revision may have been restored or removed from the archive.',
 'undeletereset'            => 'Reset',
 'undeletecomment'          => 'Comment:',
 'undeletedarticle'         => 'restored "[[$1]]"',
-'undeletedrevisions'       => '$1 revision(s) restored',
-'undeletedrevisions-files' => '$1 revision(s) and $2 file(s) restored',
-'undeletedfiles'           => '$1 file(s) restored',
+'undeletedrevisions'       => '{{PLURAL:$1|1 revision|$1 revisions}} restored',
+'undeletedrevisions-files' => '{{PLURAL:$1|1 revision|$1 revisions}} and {{PLURAL:$2|1 file|$2 files}} restored',
+'undeletedfiles'           => '{{PLURAL:$1|1 file|$1 files}} restored',
 'cannotundelete'           => 'Undelete failed; someone else may have undeleted the page first.',
 'undeletedpage'            => "<big>'''$1 has been restored'''</big>