r114002 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r114001‎ | r114002 | r114003 >
Date:07:18, 16 March 2012
Author:santhosh
Status:ok
Tags:i18nreview 
Comment:
Minor white space fix
prefix ag- for aggregrate group Ids.
If the name contains comma, make it underscore.
Ping r113709 and r113715
Modified paths:
  • /trunk/extensions/Translate/api/ApiAggregateGroups.php (modified) (history)
  • /trunk/extensions/Translate/resources/ext.translate.special.aggregategroups.js (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/api/ApiAggregateGroups.php
@@ -173,7 +173,7 @@
174174 public static function getAllPages() {
175175 $groups = MessageGroups::getAllGroups();
176176 $pages = array();
177 - foreach ( $groups as $group ) {
 177+ foreach ( $groups as $group ) {
178178 if ( $group instanceof WikiPageMessageGroup ) {
179179 $pages[$group->getId()] = $group->getTitle()->getPrefixedText();
180180 }
Index: trunk/extensions/Translate/resources/ext.translate.special.aggregategroups.js
@@ -93,11 +93,11 @@
9494 }
9595
9696 /*
97 - * Replace some special characters like space, comma, brackets etc to _ in a string. Also convert it to lowercase.
 97+ * Replace some special characters like space, dots, comma, brackets etc to _ in a string. Also convert it to lowercase.
9898 */
9999 function createId( s ){
100100 if ( s !== undefined ) {
101 - return s.toLowerCase().replace( /[\x00-\x1f\x23\x2c\x3c\x3e\x5b\x5d\x7b\x7c\x7d\x7f\s]+/g, '_' );
 101+ return 'ag-' + s.toLowerCase().replace( /[\x00-\x1f\x23\x2c\x2e\x3c\x3e\x5b\x5d\x7b\x7c\x7d\x7f\s]+/g, '_' );
102102 }
103103 }
104104
@@ -129,7 +129,7 @@
130130 $div.data( 'id', aggregateGroupId );
131131 if ( $select.length > 0 ){
132132 var $groupSelector = $( '<select>' ).attr('id', 'mw-tpa-groupselect-' + aggregateGroupId );
133 - $.each(data.aggregategroups.groups, function( key, value) {
 133+ $.each( data.aggregategroups.groups, function( key, value ) {
134134 $groupSelector.append( $( '<option>', { value : key } ).text( value ) );
135135 } );
136136 var $addButton = $( $( 'input.tp-aggregate-add-button' )[0]).clone();

Follow-up revisions

RevisionCommit summaryAuthorDate
r114127Use agg- instead of ag- (bikeshedding), ping r114002nikerabbit11:17, 19 March 2012

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r113709create the groupdId by more better....santhosh06:32, 13 March 2012
r113715Fix the broken 'add new aggregate group' in r113631...santhosh11:04, 13 March 2012

Status & tagging log