74 $this->mIndexField =
'am_title';
78 $contLang = MediaWikiServices::getInstance()->getContentLanguage();
81 $this->langcode = $this->lang->getCode();
82 $this->foreign = !$this->lang->equals( $contLang );
88 $this->custom = (
$filter ===
'unmodified' );
97 $displayPrefix =
$prefix->getDBkey();
98 $this->prefix =
'/^' . preg_quote( $displayPrefix,
'/' ) .
'/i';
100 $this->prefix =
false;
105 if ( $this->foreign ) {
116 $messageNames = array_map( [ $this->lang,
'ucfirst' ], $messageNames );
119 rsort( $messageNames );
121 asort( $messageNames );
124 return $messageNames;
143 [
'page_namespace',
'page_title' ],
146 [
'USE INDEX' =>
'name_title' ]
148 $xNames = array_flip( $messageNames );
150 $pageFlags = $talkFlags = [];
156 $titleParts = explode(
'/',
$s->page_title );
157 if ( count( $titleParts ) === 2 &&
159 isset( $xNames[$titleParts[0]] )
161 $exists = $titleParts[0];
163 } elseif ( isset( $xNames[
$s->page_title] ) ) {
164 $exists =
$s->page_title;
169 $pageFlags[$exists] =
true;
171 $talkFlags[$exists] =
true;
175 return [
'pages' => $pageFlags,
'talks' => $talkFlags ];
194 foreach ( $messageNames as $key ) {
195 $customised = isset( $statuses[
'pages'][$key] );
196 if ( $customised !== $this->custom &&
197 ( $asc && ( $key < $offset || !$offset ) || !$asc && $key > $offset ) &&
198 ( ( $this->prefix && preg_match( $this->prefix, $key ) ) || $this->prefix ===
false )
200 $actual = $this->
msg( $key )->inLanguage( $this->lang )->plain();
201 $default = $this->
msg( $key )->inLanguage( $this->lang )->useDatabase(
false )->plain();
204 'am_actual' => $actual,
205 'am_default' => $default,
206 'am_customised' => $customised,
207 'am_talk_exists' => isset( $statuses[
'talks'][$key] )
212 if ( $count === $limit ) {
223 'class' =>
"mw-datatable $tableClass",
224 'id' =>
'mw-allmessagestable'
228 <th rowspan=\"2\">" .
229 $this->
msg(
'allmessagesname' )->escaped() .
"
232 $this->
msg(
'allmessagesdefault' )->escaped() .
237 $this->
msg(
'allmessagescurrent' )->escaped() .
243 return Html::closeElement(
'table' );
254 'title' =>
'Special:SearchTranslations',
255 'group' =>
'mediawiki',
256 'grouppath' =>
'mediawiki',
258 'query' => $value .
' ' . $this->
msg( $value )->plain()
260 $this->
msg(
'allmessages-filter-translate' )->text()
262 $talkLink = $this->
msg(
'talkpagelinktext' )->escaped();
264 if ( $this->mCurrentRow->am_customised ) {
271 if ( $this->mCurrentRow->am_talk_exists ) {
281 $this->
msg(
'parentheses' )->rawParams( $talk )->escaped() .
283 $this->
msg(
'parentheses' )->rawParams( $translation )->escaped();
287 return Sanitizer::escapeHtmlAllowEntities( $value );
299 $s = parent::formatRow( $row );
302 if ( $row->am_customised ) {
303 $s .= Html::openElement(
'tr', $this->
getRowAttrs( $row,
true ) );
304 $formatted = strval( $this->
formatValue(
'am_actual', $row->am_actual ) );
306 if ( $formatted ===
'' ) {
307 $formatted =
"\u{00A0}";
310 $s .= Html::element(
'td', $this->
getCellAttrs(
'am_actual', $row->am_actual ), $formatted )
311 . Html::closeElement(
'tr' );
314 return Html::rawElement(
'tbody', [],
$s );
328 if ( $field ===
'am_title' ) {
329 if ( $this->mCurrentRow->am_customised ) {
330 $attr += [
'rowspan' =>
'2' ];
334 'lang' => $this->lang->getHtmlCode(),
335 'dir' => $this->lang->getDir(),
337 if ( $this->mCurrentRow->am_customised ) {
339 $attr += [
'class' => $field ];
348 'am_title' => $this->
msg(
'allmessagesname' )->text(),
349 'am_default' => $this->
msg(
'allmessagesdefault' )->text()