r100016 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r100015‎ | r100016 | r100017 >
Date:07:56, 17 October 2011
Author:raymond
Status:ok (Comments)
Tags:
Comment:
Run some filter IDs through formatNum() for better l10n
Modified paths:
  • /trunk/extensions/AbuseFilter/Views/AbuseFilterViewEdit.php (modified) (history)
  • /trunk/extensions/AbuseFilter/Views/AbuseFilterViewHistory.php (modified) (history)
  • /trunk/extensions/AbuseFilter/Views/AbuseFilterViewList.php (modified) (history)
  • /trunk/extensions/AbuseFilter/special/SpecialAbuseLog.php (modified) (history)

Diff [purge]

Index: trunk/extensions/AbuseFilter/special/SpecialAbuseLog.php
@@ -437,14 +437,11 @@
438438 WikiMap::getForeignURL( $wgAbuseFilterCentralDB,
439439 'Special:AbuseFilter/' . $globalIndex );
440440
441 - $linkText = wfMsgExt( 'abusefilter-log-detailedentry-global',
442 - 'parseinline', array( $globalIndex ) );
443 -
 441+ $linkText = wfMessage( 'abusefilter-log-detailedentry-global' )->numParams( $globalIndex )->escaped();
444442 $filterLink = $sk->makeExternalLink( $globalURL, $linkText );
445443 } else {
446444 $title = SpecialPage::getTitleFor( 'AbuseFilter', $row->afl_filter );
447 - $linkText = wfMsgExt( 'abusefilter-log-detailedentry-local',
448 - 'parseinline', array( $row->afl_filter ) );
 445+ $linkText = wfMessage( 'abusefilter-log-detailedentry-local' )->numParams( $row->afl_filter )->escaped();
449446 $filterLink = $sk->link( $title, $linkText );
450447 }
451448 $description = wfMsgExt( 'abusefilter-log-detailedentry-meta',
Index: trunk/extensions/AbuseFilter/Views/AbuseFilterViewList.php
@@ -187,7 +187,7 @@
188188 switch( $name ) {
189189 case 'af_id':
190190 return Linker::link(
191 - SpecialPage::getTitleFor( 'AbuseFilter', intval( $value ) ), intval( $value ) );
 191+ SpecialPage::getTitleFor( 'AbuseFilter', intval( $value ) ), $wgLang->formatNum( intval( $value ) ) );
192192 case 'af_public_comments':
193193 return Linker::link(
194194 SpecialPage::getTitleFor( 'AbuseFilter', intval( $row->af_id ) ),
Index: trunk/extensions/AbuseFilter/Views/AbuseFilterViewHistory.php
@@ -131,6 +131,9 @@
132132 $row = $this->mCurrentRow;
133133
134134 switch( $name ) {
 135+ case 'afh_filter':
 136+ $formatted = $wgLang->formatNum ( $row->afh_filter );
 137+ break;
135138 case 'afh_timestamp':
136139 $title = SpecialPage::getTitleFor( 'AbuseFilter',
137140 'history/' . $row->afh_filter . '/item/' . $row->afh_id );
Index: trunk/extensions/AbuseFilter/Views/AbuseFilterViewEdit.php
@@ -235,6 +235,8 @@
236236 }
237237
238238 function buildFilterEditor( $error, $filter, $history_id = null ) {
 239+ global $wgLang;
 240+
239241 if ( $filter === null ) {
240242 return false;
241243 }
@@ -278,7 +280,7 @@
279281 $fields = array();
280282
281283 $fields['abusefilter-edit-id'] =
282 - $this->mFilter == 'new' ? wfMsg( 'abusefilter-edit-new' ) : $filter;
 284+ $this->mFilter == 'new' ? wfMsg( 'abusefilter-edit-new' ) : $wgLang->formatNum( $filter );
283285 $fields['abusefilter-edit-description'] =
284286 Xml::input(
285287 'wpFilterDescription',

Comments

#Comment by Siebrand (talk | contribs)   09:22, 17 October 2011

Iirc there is an open bugzilla for this, and it is assigned to a novice developer. Happened 6 weeks or so ago during an i18n triage.

#Comment by Raymond (talk | contribs)   09:39, 17 October 2011

Bug 30729. Sorry, I was not aware of this bug. It was not my intention to "steal" an easy bug from a novice developer.

Status & tagging log