From a0d40e108b19cbc3e0987d209a1303b41a641795 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Niklas=20Laxstr=C3=B6m?= Date: Fri, 12 Oct 2007 15:33:58 +0000 Subject: [PATCH] * Support plural in undeleted{revisions,revisions-files,files} --- RELEASE-NOTES | 1 + includes/GlobalFunctions.php | 13 +++++++++---- languages/messages/MessagesEn.php | 6 +++--- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 1ad1b682ac..b4f3d2c83b 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 === diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index b216eca9b3..38f07536e9 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -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 ) { * escape: filters message trough htmlspecialchars * replaceafter: parameters are substituted after parsing or escaping * parsemag: transform the message using magic phrases + * content: 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 ); diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index c038db26df..c13c4506ea 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -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' => "'''$1 has been restored''' -- 2.20.1