r78968 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r78967‎ | r78968 | r78969 >
Date:16:06, 24 December 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
to capitalization function
Modified paths:
  • /trunk/extensions/LiveTranslate/RELEASE-NOTES (modified) (history)
  • /trunk/extensions/LiveTranslate/includes/LiveTranslate_Functions.php (modified) (history)

Diff [purge]

Index: trunk/extensions/LiveTranslate/RELEASE-NOTES
@@ -5,7 +5,7 @@
66
77
88 === Version 0.2 ===
9 -201x-xx-xx
 9+2010-12-24
1010
1111 * Fixed installation compatibility issue with MW 1.16.
1212 * Fixed display of translation control to only happen on existing pages.
Index: trunk/extensions/LiveTranslate/includes/LiveTranslate_Functions.php
@@ -369,11 +369,11 @@
370370 * @return mixed
371371 */
372372 public static function getToggledCase( $text ) {
373 - $isUpper = $text{0} == strtoupper( $text{0} );
374 - $isLower = $text{0} == strtolower( $text{0} );
 373+ $isUpper = Language::firstChar( $text) == strtoupper( Language::firstChar( $text) );
 374+ $isLower = Language::firstChar( $text) == strtolower( Language::firstChar( $text) );
375375
376376 if ( $isUpper XOR $isLower ) {
377 - $text{0} = $isUpper ? strtolower( $text{0} ) : strtoupper( $text{0} );
 377+ $text = $isUpper ? Language::lcfirst( $text ) : Language::ucfirst( $text );
378378 return $text;
379379 }
380380 else {

Status & tagging log