74 $this->mIndexField =
'am_title';
78 $contLang = MediaWikiServices::getInstance()->getContentLanguage();
81 $this->langcode = $this->lang->getCode();
82 $this->foreign = !$this->lang->equals( $contLang );
84 $filter = $opts->
getValue(
'filter' );
85 if ( $filter ===
'all' ) {
88 $this->custom = ( $filter ===
'unmodified' );
97 $displayPrefix =
$prefix->getDBkey();
98 $this->prefix =
'/^' . preg_quote( $displayPrefix,
'/' ) .
'/i';
100 $this->prefix =
false;
105 if ( $this->foreign ) {
113 $messageNames = MediaWikiServices::getInstance()
114 ->getLocalisationCache()
115 ->getSubitemList(
'en',
'messages' );
118 $messageNames = array_map( [ $this->lang,
'ucfirst' ], $messageNames );
121 rsort( $messageNames );
123 asort( $messageNames );
126 return $messageNames;
145 [
'page_namespace',
'page_title' ],
148 [
'USE INDEX' =>
'name_title' ]
150 $xNames = array_flip( $messageNames );
152 $pageFlags = $talkFlags = [];
158 $titleParts = explode(
'/',
$s->page_title );
159 if ( count( $titleParts ) === 2 &&
161 isset( $xNames[$titleParts[0]] )
163 $exists = $titleParts[0];
165 } elseif ( isset( $xNames[
$s->page_title] ) ) {
166 $exists =
$s->page_title;
171 $pageFlags[$exists] =
true;
173 $talkFlags[$exists] =
true;
177 return [
'pages' => $pageFlags,
'talks' => $talkFlags ];
196 foreach ( $messageNames as $key ) {
197 $customised = isset( $statuses[
'pages'][$key] );
198 if ( $customised !== $this->custom &&
199 ( $asc && ( $key < $offset || !$offset ) || !$asc && $key > $offset ) &&
200 ( ( $this->prefix && preg_match( $this->prefix, $key ) ) || $this->prefix ===
false )
202 $actual = $this->
msg( $key )->inLanguage( $this->lang )->plain();
203 $default = $this->
msg( $key )->inLanguage( $this->lang )->useDatabase(
false )->plain();
206 'am_actual' => $actual,
207 'am_default' => $default,
208 'am_customised' => $customised,
209 'am_talk_exists' => isset( $statuses[
'talks'][$key] )
214 if ( $count === $limit ) {
224 return Xml::openElement(
'table', [
225 'class' =>
"mw-datatable $tableClass",
226 'id' =>
'mw-allmessagestable'
230 <th rowspan=\"2\">" .
231 $this->
msg(
'allmessagesname' )->escaped() .
"
234 $this->
msg(
'allmessagesdefault' )->escaped() .
239 $this->
msg(
'allmessagescurrent' )->escaped() .
245 return Html::closeElement(
'table' );
256 'title' =>
'Special:SearchTranslations',
257 'group' =>
'mediawiki',
258 'grouppath' =>
'mediawiki',
260 'query' => $value .
' ' . $this->
msg( $value )->plain()
262 $this->
msg(
'allmessages-filter-translate' )->text()
264 $talkLink = $this->
msg(
'talkpagelinktext' )->escaped();
266 if ( $this->mCurrentRow->am_customised ) {
273 if ( $this->mCurrentRow->am_talk_exists ) {
283 $this->
msg(
'parentheses' )->rawParams( $talk )->escaped() .
285 $this->
msg(
'parentheses' )->rawParams( $translation )->escaped();
289 return Sanitizer::escapeHtmlAllowEntities( $value );
301 $s = parent::formatRow( $row );
304 if ( $row->am_customised ) {
306 $formatted = strval( $this->
formatValue(
'am_actual', $row->am_actual ) );
308 if ( $formatted ===
'' ) {
309 $formatted =
"\u{00A0}";
312 $s .= Html::element(
'td', $this->
getCellAttrs(
'am_actual', $row->am_actual ), $formatted )
313 . Html::closeElement(
'tr' );
316 return Html::rawElement(
'tbody', [],
$s );
330 if ( $field ===
'am_title' ) {
331 if ( $this->mCurrentRow->am_customised ) {
332 $attr += [
'rowspan' =>
'2' ];
336 'lang' => $this->lang->getHtmlCode(),
337 'dir' => $this->lang->getDir(),
339 if ( $this->mCurrentRow->am_customised ) {
341 $attr += [
'class' => $field ];
350 'am_title' => $this->
msg(
'allmessagesname' )->text(),
351 'am_default' => $this->
msg(
'allmessagesdefault' )->text()
wfGetLangObj( $langcode=false)
Return a Language object from $langcode.
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
wfArrayToCgi( $array1, $array2=null, $prefix='')
This function takes one or two arrays as input, and returns a CGI-style string, e....
msg( $key,... $params)
Get a Message object with context set Parameters are the same as wfMessage()
Internationalisation code See https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation for more...
static makeExternalLink( $url, $text, $escape=true, $linktype='', $attribs=[], $title=null)
Make an external link.
static getTitleFor( $name, $subpage=false, $fragment='')
Get a localised Title object for a specified special page name If you don't need a full Title object,...
Interface for objects which can provide a MediaWiki context on request.