Merge "Mention translatewiki.net on edits only, when edit a default message"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Mon, 20 Oct 2014 17:08:51 +0000 (17:08 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 20 Oct 2014 17:08:51 +0000 (17:08 +0000)
includes/EditPage.php
languages/i18n/en.json
languages/i18n/qqq.json

index ca28c07..764f413 100644 (file)
@@ -2107,6 +2107,17 @@ class EditPage {
                if ( $namespace == NS_MEDIAWIKI ) {
                        # Show a warning if editing an interface message
                        $wgOut->wrapWikiMsg( "<div class='mw-editinginterface'>\n$1\n</div>", '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( "<div class='mw-translateinterface'>\n$1\n</div>",
+                                               'translateinterface' );
+                               }
+                       }
                } elseif ( $namespace == NS_FILE ) {
                        # Show a hint to shared repo
                        $file = wfFindFile( $this->mTitle );
index 77f707a..7e6e250 100644 (file)
        "viewsourcetext": "You can view and copy the source of this page:",
        "viewyourtext": "You can view and copy the source of <strong>your edits</strong> 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": "<strong>Warning:</strong> 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": "<strong>Warning:</strong> 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 <strong>$1</strong> namespace.",
        "customcssprotected": "You do not have permission to edit this CSS page because it contains another user's personal settings.",
index d938f6f..6fa5678 100644 (file)
        "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",