From 1b878854cbfa6243419105165944effbc303082c Mon Sep 17 00:00:00 2001 From: umherirrender Date: Mon, 6 Oct 2014 21:04:25 +0200 Subject: [PATCH] Mention translatewiki.net on edits only, when edit a default message When editing a page in the mediawiki namespace the hint to translatewiki.net is always shown, but it is unneeded, when the message is not a default message and maybe used for warnings in abusefilter or is a gadget description. Change-Id: I7dbf030311e30ce852459e363c91e988ca15d86d --- includes/EditPage.php | 11 +++++++++++ languages/i18n/en.json | 3 ++- languages/i18n/qqq.json | 1 + 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/includes/EditPage.php b/includes/EditPage.php index a423f260c7..c5ef534020 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -2106,6 +2106,17 @@ class EditPage { if ( $namespace == NS_MEDIAWIKI ) { # Show a warning if editing an interface message $wgOut->wrapWikiMsg( "
\n$1\n
", 'editinginterface' ); + # If this is a default message (but not css or js), + # show a hint that it is translatable on translatewiki.net + if ( !$this->mTitle->hasContentModel( CONTENT_MODEL_CSS ) + && !$this->mTitle->hasContentModel( CONTENT_MODEL_JAVASCRIPT ) + ) { + $defaultMessageText = $this->mTitle->getDefaultMessageText(); + if ( $defaultMessageText !== false ) { + $wgOut->wrapWikiMsg( "
\n$1\n
", + 'translateinterface' ); + } + } } elseif ( $namespace == NS_FILE ) { # Show a hint to shared repo $file = wfFindFile( $this->mTitle ); diff --git a/languages/i18n/en.json b/languages/i18n/en.json index fc47178d4e..b8ea45537f 100644 --- a/languages/i18n/en.json +++ b/languages/i18n/en.json @@ -346,7 +346,8 @@ "viewsourcetext": "You can view and copy the source of this page:", "viewyourtext": "You can view and copy the source of your edits to this page:", "protectedinterface": "This page provides interface text for the software on this wiki, and is protected to prevent abuse.\nTo add or change translations for all wikis, please use [//translatewiki.net/ translatewiki.net], the MediaWiki localisation project.", - "editinginterface": "Warning: You are editing a page that is used to provide interface text for the software.\nChanges to this page will affect the appearance of the user interface for other users on this wiki.\nTo add or change translations for all wikis, please use [//translatewiki.net/ translatewiki.net], the MediaWiki localisation project.", + "editinginterface": "Warning: You are editing a page that is used to provide interface text for the software.\nChanges to this page will affect the appearance of the user interface for other users on this wiki.", + "translateinterface": "To add or change translations for all wikis, please use [//translatewiki.net/ translatewiki.net], the MediaWiki localisation project.", "cascadeprotected": "This page has been protected from editing because it is included in the following {{PLURAL:$1|page, which is|pages, which are}} protected with the \"cascading\" option turned on:\n$2", "namespaceprotected": "You do not have permission to edit pages in the $1 namespace.", "customcssprotected": "You do not have permission to edit this CSS page because it contains another user's personal settings.", diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json index c50a02fbe8..49d4201d16 100644 --- a/languages/i18n/qqq.json +++ b/languages/i18n/qqq.json @@ -509,6 +509,7 @@ "viewyourtext": "Same as {{msg-mw|viewsourcetext}} but when showing the text submitted by the user, this happens e.g. when the user was blocked while he is editing the page", "protectedinterface": "Message shown if a user without the \"editinterface\" right tries to edit a page in the MediaWiki namespace.\n\nSee also {{msg-mw|editinginterface}}. Parameters:\n* $1 - (Unused) the action the user attempted to perform", "editinginterface": "A message shown when editing pages in the namespace MediaWiki:.\n\nSee also {{msg-mw|protectedinterface}}.", + "translateinterface": "A message shown when editing pages in the namespace MediaWiki:, which have a default message text.\n\nSee also {{msg-mw|protectedinterface}}, {{msg-mw|editinginterface}}.", "cascadeprotected": "Parameters:\n* $1 - number of cascade-protected pages, used for PLURAL\n* $2 - list of cascade-protected pages\n* $3 - (Unused) the action the user attempted to perform", "namespaceprotected": "Parameters:\n* $1 - namespace name\n* $2 - (Unused) the action the user attempted to perform", "customcssprotected": "Used as error message. Parameters:\n* $1 - (Unused) the action the user attempted to perform", -- 2.20.1