Merge ""Show Changes" on default messages shows now diff against default message...
authorBrion VIBBER <brion@wikimedia.org>
Thu, 5 Apr 2012 23:02:18 +0000 (23:02 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 5 Apr 2012 23:02:18 +0000 (23:02 +0000)
RELEASE-NOTES-1.20
includes/EditPage.php
languages/messages/MessagesEn.php
languages/messages/MessagesQqq.php
maintenance/language/messages.inc

index 3f6a79f..9c05349 100644 (file)
@@ -34,6 +34,7 @@ production.
 * (bug 34355) add a variable and parser function for the namespace number.
 * (bug 35649) Special:Version now shows hashes of extensions checked out from git.
 * (bug 35728) Git revisions are now linked on Special:Version.
+* "Show Changes" on default messages shows now diff against default message text
 
 === Bug fixes in 1.20 ===
 * (bug 30245) Use the correct way to construct a log page title.
index 0b879c1..69187e4 100644 (file)
@@ -2335,7 +2335,16 @@ HTML
        function showDiff() {
                global $wgUser, $wgContLang, $wgParser, $wgOut;
 
-               $oldtext = $this->mArticle->getRawText();
+               $oldtitlemsg = 'currentrev';
+               # if message does not exist, show diff against the preloaded default
+               if( $this->mTitle->getNamespace() == NS_MEDIAWIKI && !$this->mTitle->exists() ) {
+                       $oldtext = $this->mTitle->getDefaultMessageText();
+                       if( $oldtext !== false ) {
+                               $oldtitlemsg = 'defaultmessagetext';
+                       }
+               } else {
+                       $oldtext = $this->mArticle->getRawText();
+               }
                $newtext = $this->mArticle->replaceSection(
                        $this->section, $this->textbox1, $this->summary, $this->edittime );
 
@@ -2345,7 +2354,7 @@ HTML
                $newtext = $wgParser->preSaveTransform( $newtext, $this->mTitle, $wgUser, $popts );
 
                if ( $oldtext !== false  || $newtext != '' ) {
-                       $oldtitle = wfMsgExt( 'currentrev', array( 'parseinline' ) );
+                       $oldtitle = wfMsgExt( $oldtitlemsg, array( 'parseinline' ) );
                        $newtitle = wfMsgExt( 'yourtext', array( 'parseinline' ) );
 
                        $de = new DifferenceEngine( $this->mArticle->getContext() );
index 7feec9d..ab3182d 100644 (file)
@@ -1463,6 +1463,7 @@ It appears to have been deleted.',
 It already exists.',
 'addsection-preload'               => '', # do not translate or duplicate this message to other languages
 'addsection-editintro'             => '', # do not translate or duplicate this message to other languages
+'defaultmessagetext'               => 'Default message text',
 
 # Parser/template warnings
 'expensive-parserfunction-warning'        => "'''Warning:''' This page contains too many expensive parser function calls.
index f8577b0..11b0393 100644 (file)
@@ -1001,6 +1001,7 @@ Please report at [[Support]] if you are unable to properly translate this messag
 'recreate-moveddeleted-warn' => 'Warning shown when creating a page which has already been deleted. See for example [[Test]].',
 'moveddeleted-notice' => 'Shown on top of a deleted page in normal view modus ([http://translatewiki.net/wiki/Test example]).',
 'edit-conflict' => "An 'Edit conflict' happens when more than one edit is being made to a page at the same time. This would usually be caused by separate individuals working on the same page. However, if the system is slow, several edits from one individual could back up and attempt to apply simultaneously - causing the conflict.",
+'defaultmessagetext' => 'Header in diff view, when using "Show Changes" on an default message, which shows a diff against the default message text',
 
 # Parser/template warnings
 'expensive-parserfunction-warning' => 'On some (expensive) [[MetaWikipedia:Help:ParserFunctions|parser functions]] (e.g. <code><nowiki>{{#ifexist:}}</nowiki></code>) there is a limit of how many times it may be used. This is an error message shown when the limit is exceeded.
index 230f397..3c74403 100644 (file)
@@ -675,6 +675,7 @@ $wgMessageStructure = array(
                'edit-already-exists',
                'addsection-preload',
                'addsection-editintro',
+               'defaultmessagetext',
        ),
        'parserwarnings' => array(
                'expensive-parserfunction-warning',