r96650 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96649‎ | r96650 | r96651 >
Date:09:03, 9 September 2011
Author:nikerabbit
Status:ok
Tags:
Comment:
txt2cdb was broken for all language names which had spaces in them.
Fixed the script and committing updated cdb
Reported as bug 28117
Modified paths:
  • /trunk/extensions/Babel/names.cdb (modified) (history)
  • /trunk/extensions/Babel/txt2cdb.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Babel/names.cdb
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: trunk/extensions/Babel/txt2cdb.php
@@ -16,9 +16,11 @@
1717
1818 $fr = fopen( dirname( __FILE__ ) . '/codes.txt', 'r' );
1919 while ( $line = fgets( $fr ) ) {
20 - $line = explode( ' ', $line );
 20+ // Format is code1 code2 "language name"
 21+ $line = explode( ' ', $line, 3 );
2122 $iso1 = trim( $line[0] );
2223 $iso3 = trim( $line[1] );
 24+ // Strip quotes
2325 $name = substr( trim( $line[2] ), 1, -1 );
2426 if ( $iso1 !== '-' ) {
2527 $codes->set( $iso1, $iso1 );

Status & tagging log