From 903b3c47ef8bb0e60161b8ddac0aa1398ace3a03 Mon Sep 17 00:00:00 2001 From: umherirrender Date: Sun, 1 Apr 2012 09:40:54 +0200 Subject: [PATCH] (bug 22870) Separate interface message when creating a page Add new message 'creating' and use it for the page title of the edit page. Change-Id: I8435d21a3674b48ec5a14481cdacf0a52662fa1f --- RELEASE-NOTES-1.20 | 1 + includes/EditPage.php | 22 +++++++++++----------- languages/messages/MessagesEn.php | 1 + languages/messages/MessagesQqq.php | 1 + maintenance/language/messages.inc | 1 + 5 files changed, 15 insertions(+), 11 deletions(-) diff --git a/RELEASE-NOTES-1.20 b/RELEASE-NOTES-1.20 index b358e79ac6..1925d1393a 100644 --- a/RELEASE-NOTES-1.20 +++ b/RELEASE-NOTES-1.20 @@ -26,6 +26,7 @@ production. generating various tokens. * (bug 30963) Option on Special:Prefixindex and Special:Allpages to not show redirects. * (bug 18062) new message when edit or create the local page of a shared file +* (bug 22870) Separate interface message when creating a page === Bug fixes in 1.20 === * (bug 30245) Use the correct way to construct a log page title. diff --git a/includes/EditPage.php b/includes/EditPage.php index 052a7834d4..5e3a964842 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -1603,21 +1603,21 @@ class EditPage { # Enabled article-related sidebar, toplinks, etc. $wgOut->setArticleRelated( true ); + $contextTitle = $this->getContextTitle(); if ( $this->isConflict ) { - $wgOut->setPageTitle( wfMessage( 'editconflict', $this->getContextTitle()->getPrefixedText() ) ); - } elseif ( $this->section != '' ) { + $msg = 'editconflict'; + } elseif ( $contextTitle->exists() && $this->section != '' ) { $msg = $this->section == 'new' ? 'editingcomment' : 'editingsection'; - $wgOut->setPageTitle( wfMessage( $msg, $this->getContextTitle()->getPrefixedText() ) ); } else { - # Use the title defined by DISPLAYTITLE magic word when present - if ( isset( $this->mParserOutput ) - && ( $dt = $this->mParserOutput->getDisplayTitle() ) !== false ) { - $title = $dt; - } else { - $title = $this->getContextTitle()->getPrefixedText(); - } - $wgOut->setPageTitle( wfMessage( 'editing', $title ) ); + $msg = $contextTitle->exists() || ( $contextTitle->getNamespace() == NS_MEDIAWIKI && $contextTitle->getDefaultMessageText() !== false ) ? + 'editing' : 'creating'; + } + # Use the title defined by DISPLAYTITLE magic word when present + $displayTitle = isset( $this->mParserOutput ) ? $this->mParserOutput->getDisplayTitle() : false; + if ( $displayTitle === false ) { + $displayTitle = $contextTitle->getPrefixedText(); } + $wgOut->setPageTitle( wfMessage( $msg, $displayTitle ) ); } /** diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 6186892015..398e881485 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -1388,6 +1388,7 @@ The edit has been rejected to prevent corruption of the page text. This sometimes happens when you are using a buggy web-based anonymous proxy service.", 'edit_form_incomplete' => "'''Some parts of the edit form did not reach the server; double-check that your edits are intact and try again.'''", 'editing' => 'Editing $1', +'creating' => 'Creating $1', 'editingsection' => 'Editing $1 (section)', 'editingcomment' => 'Editing $1 (new section)', 'editconflict' => 'Edit conflict: $1', diff --git a/languages/messages/MessagesQqq.php b/languages/messages/MessagesQqq.php index 4eb4b0dbce..6bd933c738 100644 --- a/languages/messages/MessagesQqq.php +++ b/languages/messages/MessagesQqq.php @@ -971,6 +971,7 @@ See also {{msg-mw|Noarticletext-nopermission}}.', 'updated' => '{{Identical|Updated}}', 'previewnote' => 'Note displayed when clicking on Show preview', 'editing' => "Shown as page title when editing a page. \$1 is the name of the page that is being edited. Example: \"''Editing Main Page''\".", +'creating' => "Shown as page title when creating a page. \$1 is the name of the page that is being created. Example: \"''Creating Main Page''\".", 'editingsection' => 'The variable $1 is the page name. This message displays at the top of the page when a user is editing a page section.', 'explainconflict' => 'Appears at the top of a page when there is an edit conflict.', 'storedversion' => 'This is used in an edit conflict as the label for the top revision that has been stored, as opposed to your version that has not been stored which is shown at the bottom of the page.', diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index 29c5c05e15..d88cc3fe0a 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -628,6 +628,7 @@ $wgMessageStructure = array( 'token_suffix_mismatch', 'edit_form_incomplete', 'editing', + 'creating', 'editingsection', 'editingcomment', 'editconflict', -- 2.20.1