* (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.
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 );
$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() );
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.
'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.
'edit-already-exists',
'addsection-preload',
'addsection-editintro',
+ 'defaultmessagetext',
),
'parserwarnings' => array(
'expensive-parserfunction-warning',