* (bug 18190) Proper parsing in MediaWiki:Sharedupload message
authorNiklas Laxström <nikerabbit@users.mediawiki.org>
Sat, 28 Mar 2009 08:21:29 +0000 (08:21 +0000)
committerNiklas Laxström <nikerabbit@users.mediawiki.org>
Sat, 28 Mar 2009 08:21:29 +0000 (08:21 +0000)
* Also remove the lego thing: http://translatewiki.net/wiki/Support#shareduploadwiki-linktext_is_used_in_different_ways

RELEASE-NOTES
includes/ImagePage.php
languages/messages/MessagesEn.php

index aa5e6a6..72f79a8 100644 (file)
@@ -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
index 4f3b859..5e72b47 100644 (file)
@@ -483,20 +483,18 @@ EOT
 
                $descUrl = $this->img->getDescriptionUrl();
                $descText = $this->img->getDescriptionText();
+
+               $wrap = "<div class='sharedUploadNotice'>\n$1\n</div>";
+               $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  = "<div class='sharedUploadNotice'>";
-               $s .= wfMsgWikiHtml( 'sharedupload', $this->img->getRepo()->getDisplayName(), $msg );
-               $s .= "</div>";
-               $wgOut->addHTML( $s );
 
                if( $descText ) {
                        $this->mExtraDescription = $descText;
index 8ee63de..825c2bb 100644 (file)
@@ -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',