r107334 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r107333‎ | r107334 | r107335 >
Date:18:49, 26 December 2011
Author:reedy
Status:ok
Tags:
Comment:
Fix phase3 class name collision

Rename "Language" to "WDLanguage"
Modified paths:
  • /trunk/extensions/Wikidata/util/voctrain/i18n/getkey.php (modified) (history)
  • /trunk/extensions/Wikidata/util/voctrain/i18n/language.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Wikidata/util/voctrain/i18n/language.php
@@ -7,7 +7,7 @@
88 * (mediawiki version is overkill for our purposes though)
99 * also, unlike mediawiki, we always use ISO 639-3 for language codes.
1010 */
11 -class Language {
 11+class WDLanguage {
1212
1313 private $code; # language code, mostly for debugging purposes
1414 private $messages; # assoc array of translations
@@ -47,7 +47,7 @@
4848 if ( $fallback[$code] === false ) {
4949 $this->fallback = false;
5050 } else {
51 - $this->fallback = new Language( $fallback[$code] );
 51+ $this->fallback = new WDLanguage( $fallback[$code] );
5252 }
5353 }
5454
@@ -83,7 +83,7 @@
8484 * @return true if safe($one)==safe($two)
8585 */
8686 public static function safeMatch( $one, $two ) {
87 - return Language::safe( $one ) == Language::safe( $two );
 87+ return WDLanguage::safe( $one ) == WDLanguage::safe( $two );
8888 }
8989
9090
Index: trunk/extensions/Wikidata/util/voctrain/i18n/getkey.php
@@ -7,12 +7,12 @@
88 require_once( "language.php" );
99
1010 print "phrase: $phrase\n";
11 -print "translatewiki.net key: " . Language::safe( $phrase ) . "\n";
12 -$language = new Language();
 11+print "translatewiki.net key: " . WDLanguage::safe( $phrase ) . "\n";
 12+$language = new WDLanguage();
1313 print "translation:\n";
1414 print "- default: " . $language->translate( $phrase ) . "\n";
1515 if ( array_key_exists( 2, $argv ) ) {
16 - $language = new Language( $argv[2] );
 16+ $language = new WDLanguage( $argv[2] );
1717 print "- " . $argv[2] . ": " . $language->translate( $phrase ) . "\n";
1818 }
1919

Status & tagging log