Merge "+Test for Status->CleanParams with a callback"
[lhc/web/wiklou.git] / includes / specials / SpecialAllmessages.php
index 855d409..71bb27a 100644 (file)
@@ -28,7 +28,6 @@
  * @ingroup SpecialPage
  */
 class SpecialAllmessages extends SpecialPage {
-
        /**
         * @var AllmessagesTablePager
         */
@@ -55,6 +54,7 @@ class SpecialAllmessages extends SpecialPage {
                global $wgUseDatabaseMessages;
                if ( !$wgUseDatabaseMessages ) {
                        $out->addWikiMsg( 'allmessagesnotsupportedDB' );
+
                        return;
                } else {
                        $this->outputHeader( 'allmessagestext' );
@@ -74,7 +74,6 @@ class SpecialAllmessages extends SpecialPage {
                        $this->table->getNavigationBar() .
                        $this->table->getBody() .
                        $this->table->getNavigationBar() );
-
        }
 
        protected function getGroupName() {
@@ -87,7 +86,6 @@ class SpecialAllmessages extends SpecialPage {
  * getting data from a table when in fact not all of it comes from the database.
  */
 class AllmessagesTablePager extends TablePager {
-
        protected $filter, $prefix, $langcode, $displayPrefix;
 
        public $mLimitsShown;
@@ -213,6 +211,7 @@ class AllmessagesTablePager extends TablePager {
                        $this->getHiddenFields( array( 'title', 'prefix', 'filter', 'lang', 'limit' ) ) .
                        Xml::closeElement( 'fieldset' ) .
                        Xml::closeElement( 'form' );
+
                return $out;
        }
 
@@ -229,6 +228,7 @@ class AllmessagesTablePager extends TablePager {
                $messageNames = array_map( array( $this->lang, 'ucfirst' ), $messageNames );
 
                wfProfileOut( __METHOD__ );
+
                return $messageNames;
        }
 
@@ -285,6 +285,9 @@ class AllmessagesTablePager extends TablePager {
        /**
         *  This function normally does a database query to get the results; we need
         * to make a pretend result using a FakeResultWrapper.
+        * @param string $offset
+        * @param int $limit
+        * @param bool $descending
         * @return FakeResultWrapper
         */
        function reallyDoQuery( $offset, $limit, $descending ) {
@@ -316,6 +319,7 @@ class AllmessagesTablePager extends TablePager {
                                break;
                        }
                }
+
                return $result;
        }
 
@@ -341,6 +345,17 @@ class AllmessagesTablePager extends TablePager {
                        case 'am_title' :
                                $title = Title::makeTitle( NS_MEDIAWIKI, $value . $this->suffix );
                                $talk = Title::makeTitle( NS_MEDIAWIKI_TALK, $value . $this->suffix );
+                               $translation = Linker::makeExternalLink(
+                                       'https://translatewiki.net/w/i.php?' . wfArrayToCgi( array(
+                                               'title' => 'Special:SearchTranslations',
+                                               'group' => 'mediawiki',
+                                               'grouppath' => 'mediawiki',
+                                               'query' => 'language:' . $this->getLanguage()->getCode() . '^25 ' .
+                                                       'messageid:"MediaWiki:' . $value . '"^10 "' .
+                                                       $this->msg ( $value )->inLanguage ( 'en' )->plain() . '"'
+                                       ) ),
+                                       $this->msg( 'allmessages-filter-translate' )->text()
+                               );
 
                                if ( $this->mCurrentRow->am_customised ) {
                                        $title = Linker::linkKnown( $title, $this->getLanguage()->lcfirst( $value ) );
@@ -364,7 +379,11 @@ class AllmessagesTablePager extends TablePager {
                                                array( 'broken' )
                                        );
                                }
-                               return $title . ' ' . $this->msg( 'parentheses' )->rawParams( $talk )->escaped();
+
+                               return $title . ' '
+                               . $this->msg( 'parentheses' )->rawParams( $talk )->escaped()
+                               . ' '
+                               . $this->msg( 'parentheses' )->rawParams( $translation )->escaped();
 
                        case 'am_default' :
                        case 'am_actual' :
@@ -387,6 +406,7 @@ class AllmessagesTablePager extends TablePager {
                        $s .= Xml::tags( 'td', $this->getCellAttrs( 'am_actual', $row->am_actual ), $formatted )
                                . "</tr>\n";
                }
+
                return $s;
        }
 
@@ -398,6 +418,7 @@ class AllmessagesTablePager extends TablePager {
                if ( !$isSecond ) {
                        $arr['id'] = Sanitizer::escapeId( 'msg_' . $this->getLanguage()->lcfirst( $row->am_title ) );
                }
+
                return $arr;
        }