r66798 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r66797‎ | r66798 | r66799 >
Date:15:11, 23 May 2010
Author:siebrand
Status:deferred
Tags:
Comment:
(bug 21790) Special:AdvancedTranslate does not see "a_b" and "a b" (underscore difference) as a conflict.

Pre-save, spaces are replaced with underscores now. If this results in a duplicate, the submit is not saved, but the user is notified of duplicates.
Modified paths:
  • /trunk/extensions/Translate/groups/ComplexMessages.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/groups/ComplexMessages.php
@@ -332,7 +332,12 @@
333333 foreach ( array_keys( $this->data ) as $group ) {
334334 foreach ( $this->getIterator( $group ) as $key ) {
335335 $data = $request->getText( $this->getKeyForEdit( $key ) );
336 - $data = implode( ', ', array_map( 'trim', explode( ',', $data ) ) );
 336+ // Make a nice array out of the submit with trimmed values.
 337+ $data = array_map( 'trim', explode( ',', $data ) );
 338+ // Normalise: Replace spaces with underscores.
 339+ $data = str_replace( ' ', '_', $data );
 340+ // Create final format.
 341+ $data = implode( ', ', $data );
337342 if ( $data !== '' ) {
338343 $text .= "$key = $data\n" ;
339344 }

Status & tagging log