Change linking Special:PageLanguage on action=info
authorUmherirrender <umherirrender_de.wp@web.de>
Fri, 16 Dec 2016 19:57:06 +0000 (20:57 +0100)
committerUmherirrender <umherirrender_de.wp@web.de>
Fri, 16 Dec 2016 19:57:06 +0000 (20:57 +0100)
Change from linking of description to extra link behind the data. Also
reorder the code and language name to match the order on
Special:PageLanguage

Change-Id: I859df5d04c5d937fba55c309034a0350574b5af7

includes/actions/InfoAction.php
languages/i18n/en.json
languages/i18n/qqq.json

index 6cafaa5..5fb83b3 100644 (file)
@@ -261,23 +261,22 @@ class InfoAction extends FormlessAction {
                // Language in which the page content is (supposed to be) written
                $pageLang = $title->getPageLanguage()->getCode();
 
+               $pageLangHtml = $pageLang . ' - ' .
+                       Language::fetchLanguageName( $pageLang, $lang->getCode() );
+               // Link to Special:PageLanguage with pre-filled page title if user has permissions
                if ( $config->get( 'PageLanguageUseDB' )
                        && $title->userCan( 'pagelang', $user )
                ) {
-                       // Link to Special:PageLanguage with pre-filled page title if user has permissions
-                       $titleObj = SpecialPage::getTitleFor( 'PageLanguage', $title->getPrefixedText() );
-                       $langDisp = $linkRenderer->makeLink(
-                               $titleObj,
-                               $this->msg( 'pageinfo-language' )->text()
-                       );
-               } else {
-                       // Display just the message
-                       $langDisp = $this->msg( 'pageinfo-language' )->escaped();
+                       $pageLangHtml .= ' ' . $this->msg( 'parentheses' )->rawParams( $linkRenderer->makeLink(
+                               SpecialPage::getTitleValueFor( 'PageLanguage', $title->getPrefixedText() ),
+                               $this->msg( 'pageinfo-language-change' )->text()
+                       ) )->escaped();
                }
 
-               $pageInfo['header-basic'][] = [ $langDisp,
-                       Language::fetchLanguageName( $pageLang, $lang->getCode() )
-                       . ' ' . $this->msg( 'parentheses', $pageLang )->escaped() ];
+               $pageInfo['header-basic'][] = [
+                       $this->msg( 'pageinfo-language' )->escaped(),
+                       $pageLangHtml
+               ];
 
                // Content model of the page
                $modelHtml = htmlspecialchars( ContentHandler::getLocalizedName( $title->getContentModel() ) );
index 882357f..bd1d780 100644 (file)
        "pageinfo-length": "Page length (in bytes)",
        "pageinfo-article-id": "Page ID",
        "pageinfo-language": "Page content language",
+       "pageinfo-language-change": "change",
        "pageinfo-content-model": "Page content model",
        "pageinfo-content-model-change": "change",
        "pageinfo-robot-policy": "Indexing by robots",
index d292c72..dcc3d3a 100644 (file)
        "pageinfo-length": "The length of the page, in bytes.",
        "pageinfo-article-id": "The numeric identifier of the page.\n{{Identical|Page ID}}",
        "pageinfo-language": "Language in which the page content is written.",
+       "pageinfo-language-change": "Link text for a link to Special:PageLanguage. The link will be wrapped in parenthesis.\n{{Identical|Change}}",
        "pageinfo-content-model": "The model in which the page content is written.\n\nUsed as label at [{{fullurl:Main Page|action=info}} action=info]. Followed by one of the following messages:\n* {{msg-mw|Content-model-wikitext}}\n* {{msg-mw|Content-model-javascript}}\n* {{msg-mw|Content-model-css}}\n* {{msg-mw|Content-model-text}}",
        "pageinfo-content-model-change": "Link text for a link to Special:ChangeContentModel. The link will be wrapped in parenthesis.\n{{Identical|Change}}",
        "pageinfo-robot-policy": "The search engine status of the page.\n\nUsed as label. Followed by any one of the following messages:\n*{{msg-mw|Pageinfo-robot-index}}\n*{{msg-mw|Pageinfo-robot-noindex}}",