r34245 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r34244‎ | r34245 | r34246 >
Date:14:14, 5 May 2008
Author:minuteelectron
Status:old
Tags:
Comment:
* Missed the extension name array key.
Modified paths:
  • /trunk/phase3/includes/GlobalFunctions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/GlobalFunctions.php
@@ -2484,24 +2484,28 @@
24852485 */
24862486 function wfLoadExtensionMessages( $extensionName, $langcode = false ) {
24872487 global $wgExtensionMessagesFiles, $wgMessageCache, $wgLang, $wgContLang;
2488 -
 2488+
24892489 #For recording whether extension message files have been loaded in a given language.
24902490 static $loaded = array();
2491 -
2492 - if( !$langcode && !array_key_exists( '*', $loaded ) ) {
 2491+
 2492+ if( !array_key_exists( $extensionName, $loaded ) ) {
 2493+ $wgExtensionMessagesFiles[$extensionName] = array();
 2494+ }
 2495+
 2496+ if( !$langcode && !array_key_exists( '*', $loaded[$extensionName] ) ) {
24932497 # Just do en, content language and user language.
24942498 $wgMessageCache->loadMessagesFile( $wgExtensionMessagesFiles[$extensionName], false );
24952499 # Mark that they have been loaded.
2496 - $loaded['en'] = true;
2497 - $loaded[$wgLang->getCode()] = true;
2498 - $loaded[$wgContLang->getCode()] = true;
 2500+ $loaded[$extensionName]['en'] = true;
 2501+ $loaded[$extensionName][$wgLang->getCode()] = true;
 2502+ $loaded[$extensionName][$wgContLang->getCode()] = true;
24992503 # Mark that this part has been done to avoid weird if statements.
2500 - $loaded['*'] = true;
2501 - } elseif( is_string( $langcode ) && !array_key_exists( $langcode, $loaded ) ) {
 2504+ $loaded[$extensionName]['*'] = true;
 2505+ } elseif( is_string( $langcode ) && !array_key_exists( $langcode, $loaded[$extensionName] ) ) {
25022506 # Load messages for specified language.
25032507 $wgMessageCache->loadMessagesFile( $wgExtensionMessagesFiles[$extensionName], $langcode );
25042508 # Mark that they have been loaded.
2505 - $loaded[$langcode] = true;
 2509+ $loaded[$extensionName][$langcode] = true;
25062510 }
25072511 }
25082512

Status & tagging log