Index: trunk/phase3/includes/GlobalFunctions.php |
— | — | @@ -2484,24 +2484,28 @@ |
2485 | 2485 | */ |
2486 | 2486 | function wfLoadExtensionMessages( $extensionName, $langcode = false ) { |
2487 | 2487 | global $wgExtensionMessagesFiles, $wgMessageCache, $wgLang, $wgContLang; |
2488 | | - |
| 2488 | + |
2489 | 2489 | #For recording whether extension message files have been loaded in a given language. |
2490 | 2490 | 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] ) ) { |
2493 | 2497 | # Just do en, content language and user language. |
2494 | 2498 | $wgMessageCache->loadMessagesFile( $wgExtensionMessagesFiles[$extensionName], false ); |
2495 | 2499 | # 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; |
2499 | 2503 | # 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] ) ) { |
2502 | 2506 | # Load messages for specified language. |
2503 | 2507 | $wgMessageCache->loadMessagesFile( $wgExtensionMessagesFiles[$extensionName], $langcode ); |
2504 | 2508 | # Mark that they have been loaded. |
2505 | | - $loaded[$langcode] = true; |
| 2509 | + $loaded[$extensionName][$langcode] = true; |
2506 | 2510 | } |
2507 | 2511 | } |
2508 | 2512 | |