From: Niklas Laxström Date: Sat, 28 Mar 2009 08:21:29 +0000 (+0000) Subject: * (bug 18190) Proper parsing in MediaWiki:Sharedupload message X-Git-Tag: 1.31.0-rc.0~42316 X-Git-Url: http://git.cyclocoop.org/fichier?a=commitdiff_plain;h=25506e8f15c9fac3badd272659a105b86cc79edd;p=lhc%2Fweb%2Fwiklou.git * (bug 18190) Proper parsing in MediaWiki:Sharedupload message * Also remove the lego thing: http://translatewiki.net/wiki/Support#shareduploadwiki-linktext_is_used_in_different_ways --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index aa5e6a6ae0..72f79a8627 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -295,6 +295,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN selection * The svn-version version numbers on Special:Version have been removed * (bug 17374) Special:Export no longer exports two copies of the same page +* (bug 18190) Proper parsing in MediaWiki:Sharedupload message == API changes in 1.15 == * (bug 16858) Revamped list=deletedrevs to make listing deleted contributions diff --git a/includes/ImagePage.php b/includes/ImagePage.php index 4f3b859a2b..5e72b47814 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -483,20 +483,18 @@ EOT $descUrl = $this->img->getDescriptionUrl(); $descText = $this->img->getDescriptionText(); + + $wrap = "
\n$1\n
"; + $repo = $this->img->getRepo()->getDisplayName(); + $msg = ''; - if( $descUrl ) { - $sk = $wgUser->getSkin(); - $link = $sk->makeExternalLink( $descUrl, wfMsg( 'shareduploadwiki-linktext' ) ); - $msg = ( $descText ) ? 'shareduploadwiki-desc' : 'shareduploadwiki'; - $msg = wfMsgExt( $msg, array( 'parseinline', 'replaceafter' ), $link ); - if( $msg == '-' ) { - $msg = ''; - } + if( $descUrl && $descText && wfMsgNoTrans( 'sharedupload-desc-here' ) !== '-' ) { + $wgOut->wrapWikiMsg( $wrap, array( 'sharedupload-desc-here', $repo, $descUrl ) ); + } elseif ( $descUrl && wfMsgNoTrans( 'sharedupload-desc-there' ) !== '-' ) { + $wgOut->wrapWikiMsg( $wrap, array( 'sharedupload-desc-there', $repo, $descUrl ) ); + } else { + $wgOut->wrapWikiMsg( $wrap, array( 'sharedupload', $repo ), ''/*BACKCOMPAT*/ ); } - $s = "
"; - $s .= wfMsgWikiHtml( 'sharedupload', $this->img->getRepo()->getDisplayName(), $msg ); - $s .= "
"; - $wgOut->addHTML( $s ); if( $descText ) { $this->mExtraDescription = $descText; diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 8ee63de72b..825c2bb0da 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -1990,10 +1990,9 @@ A [[Special:WhatLinksHere/$2|full list]] is available.', 'morelinkstoimage' => 'View [[Special:WhatLinksHere/$1|more links]] to this file.', 'redirectstofile' => 'The following {{PLURAL:$1|file redirects|$1 files redirect}} to this file:', 'duplicatesoffile' => 'The following {{PLURAL:$1|file is a duplicate|$1 files are duplicates}} of this file ([[Special:FileDuplicateSearch/$2|more details]]):', -'sharedupload' => 'This file is from $1 and may be used by other projects. $2', # $1 is the repo name, $2 is shareduploadwiki(-desc) -'shareduploadwiki' => 'Please see the $1 for further information.', -'shareduploadwiki-desc' => 'The description on its $1 there is shown below.', -'shareduploadwiki-linktext' => 'file description page', +'sharedupload' => 'This file is from $1 and may be used by other projects.', +'sharedupload-desc-there' => 'This file is from $1 and may be used by other projects. Please see the [$2 file description page] for further information.', +'sharedupload-desc-here' => 'This file is from $1 and may be used by other projects. The description on its [$2 file description page] there is shown below.', 'shareddescriptionfollows' => '-', # do not translate or duplicate this message to other languages 'noimage' => 'No file by this name exists, but you can $1.', 'noimage-linktext' => 'upload one',