r84664 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84663‎ | r84664 | r84665 >
Date:04:08, 24 March 2011
Author:tstarling
Status:ok (Comments)
Tags:
Comment:
* Fixed a few comments.
* Added a profiling section to loadLanguage().
Modified paths:
  • /trunk/extensions/cldr/LanguageNames.body.php (modified) (history)
  • /trunk/extensions/cldr/cldr.php (modified) (history)

Diff [purge]

Index: trunk/extensions/cldr/cldr.php
@@ -1,7 +1,7 @@
22 <?php
33 if (!defined('MEDIAWIKI')) die();
44 /**
5 - * An extension which provised localised language names for other extensions.
 5+ * An extension which provides localised language names for other extensions.
66 *
77 * @file
88 * @ingroup Extensions
@@ -22,4 +22,4 @@
2323 $dir = dirname(__FILE__) . '/';
2424 $wgExtensionMessagesFiles['cldr'] = $dir . 'cldr.i18n.php';
2525 $wgAutoloadClasses['LanguageNames'] = $dir . 'LanguageNames.body.php';
26 -$wgHooks['LanguageGetTranslatedLanguageNames'][] = 'LanguageNames::coreHook';
\ No newline at end of file
 26+$wgHooks['LanguageGetTranslatedLanguageNames'][] = 'LanguageNames::coreHook';
Index: trunk/extensions/cldr/LanguageNames.body.php
@@ -12,8 +12,8 @@
1313 private static $cache = array();
1414
1515 const FALLBACK_NATIVE = 0; // Missing entries fallback to native name
16 - const FALLBACK_NORMAL = 1; // Missing entries fallback trough fallback chain
17 - const LIST_MW_SUPPORTED = 0; // Only names that has localisation in MediaWiki
 16+ const FALLBACK_NORMAL = 1; // Missing entries fallback through the fallback chain
 17+ const LIST_MW_SUPPORTED = 0; // Only names that have localisation in MediaWiki
1818 const LIST_MW = 1; // All names that are in Names.php
1919 const LIST_MW_AND_CLDR = 2; // Combination of Names.php and what is in cldr
2020
@@ -59,6 +59,7 @@
6060
6161 private static function loadLanguage( $code ) {
6262 if ( !isset(self::$cache[$code]) ) {
 63+ wfProfileIn( __METHOD__.'-recache' );
6364
6465 /* Load override for wrong or missing entries in cldr */
6566 $override = dirname(__FILE__) . '/' . self::getOverrideFileName( $code );
@@ -84,6 +85,7 @@
8586 } else {
8687 wfDebug( __METHOD__ . ": Unable to load language names for $filename\n" );
8788 }
 89+ wfProfileOut( __METHOD__.'-recache' );
8890 }
8991
9092 return isset( self::$cache[$code] ) ? self::$cache[$code] : array();

Follow-up revisions

RevisionCommit summaryAuthorDate
r85437MFT last couple of extension revs: r84664, r84921, r85202demon14:29, 5 April 2011

Comments

#Comment by Catrope (talk | contribs)   10:32, 20 April 2011

Untagging 1.17wmf1, this extension is not used on WMF (yet).

Status & tagging log