90 $this->mIndexField =
'am_title';
96 $this->langcode = $this->lang->getCode();
97 $this->foreign = !$this->lang->equals( $contentLanguage );
99 $filter = $opts->
getValue(
'filter' );
100 if ( $filter ===
'all' ) {
101 $this->custom =
null;
103 $this->custom = ( $filter ===
'unmodified' );
112 $displayPrefix =
$prefix->getDBkey();
113 $this->prefix =
'/^' . preg_quote( $displayPrefix,
'/' ) .
'/i';
115 $this->prefix =
false;
120 if ( $this->foreign ) {
128 $messageNames = $this->localisationCache->getSubitemList(
'en',
'messages' );
131 $messageNames = array_map( [ $this->lang,
'ucfirst' ], $messageNames );
134 rsort( $messageNames );
136 asort( $messageNames );
139 return $messageNames;
166 [
'page_namespace',
'page_title' ],
169 [
'USE INDEX' =>
'page_name_title' ]
171 $xNames = array_fill_keys( $messageNames,
true );
173 $pageFlags = $talkFlags = [];
179 $titleParts = explode(
'/',
$s->page_title );
180 if ( count( $titleParts ) === 2 &&
182 isset( $xNames[$titleParts[0]] )
184 $exists = $titleParts[0];
186 } elseif ( isset( $xNames[
$s->page_title] ) ) {
187 $exists =
$s->page_title;
192 $pageFlags[$exists] =
true;
194 $talkFlags[$exists] =
true;
198 return [
'pages' => $pageFlags,
'talks' => $talkFlags ];
222 foreach ( $messageNames as $key ) {
223 $customised = isset( $statuses[
'pages'][$key] );
224 if ( $customised !== $this->custom &&
225 ( $asc && ( $key < $offset || !$offset ) || !$asc && $key > $offset ) &&
226 ( ( $this->prefix && preg_match( $this->prefix, $key ) ) || $this->prefix ===
false )
228 $actual = $this->
msg( $key )->inLanguage( $this->lang )->plain();
229 $default = $this->
msg( $key )->inLanguage( $this->lang )->useDatabase(
false )->plain();
232 'am_actual' => $actual,
233 'am_default' => $default,
234 'am_customised' => $customised,
235 'am_talk_exists' => isset( $statuses[
'talks'][$key] )
240 if ( $count === $limit ) {
250 return Xml::openElement(
'table', [
251 'class' =>
"mw-datatable $tableClass",
252 'id' =>
'mw-allmessagestable'
256 <th rowspan=\"2\">" .
257 $this->
msg(
'allmessagesname' )->escaped() .
"
260 $this->
msg(
'allmessagesdefault' )->escaped() .
265 $this->
msg(
'allmessagescurrent' )->escaped() .
271 return Html::closeElement(
'table' );
287 'title' =>
'Special:SearchTranslations',
288 'group' =>
'mediawiki',
289 'grouppath' =>
'mediawiki',
291 'query' => $value .
' ' . $this->
msg( $value )->plain()
293 $this->
msg(
'allmessages-filter-translate' )->text()
295 $talkLink = $this->
msg(
'talkpagelinktext' )->text();
297 if ( $this->mCurrentRow->am_customised ) {
304 if ( $this->mCurrentRow->am_talk_exists ) {
314 $this->
msg(
'parentheses' )->rawParams( $talk )->escaped() .
316 $this->
msg(
'parentheses' )->rawParams( $translation )->escaped();
320 return Sanitizer::escapeHtmlAllowEntities( $value );
332 $s = parent::formatRow( $row );
335 if ( $row->am_customised ) {
337 $formatted = strval( $this->
formatValue(
'am_actual', $row->am_actual ) );
339 if ( $formatted ===
'' ) {
340 $formatted =
"\u{00A0}";
343 $s .= Html::rawElement(
'td', $this->
getCellAttrs(
'am_actual', $row->am_actual ), $formatted )
344 . Html::closeElement(
'tr' );
347 return Html::rawElement(
'tbody', [],
$s );
361 if ( $field ===
'am_title' ) {
362 if ( $this->mCurrentRow->am_customised ) {
363 $attr += [
'rowspan' =>
'2' ];
367 'lang' => $this->lang->getHtmlCode(),
368 'dir' => $this->lang->getDir(),
370 if ( $this->mCurrentRow->am_customised ) {
372 $attr += [
'class' => $field ];
381 'am_title' => $this->
msg(
'allmessagesname' )->text(),
382 '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.
Class for caching the contents of localisation files, Messages*.php and *.i18n.php.
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.
foreach( $mmfl['setupFiles'] as $fileName) if($queue) if(empty( $mmfl['quiet'])) $s