summaryrefslogtreecommitdiff
path: root/includes/MessageCache.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/MessageCache.php')
-rw-r--r--includes/MessageCache.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/includes/MessageCache.php b/includes/MessageCache.php
index a06b0cb9..2236bdd7 100644
--- a/includes/MessageCache.php
+++ b/includes/MessageCache.php
@@ -702,7 +702,10 @@ class MessageCache {
* @param string $lang The messages language, English by default
*/
function addMessage( $key, $value, $lang = 'en' ) {
- $this->mExtensionMessages[$lang][$key] = $value;
+ global $wgContLang;
+ # Normalise title-case input
+ $lckey = str_replace( ' ', '_', $wgContLang->lcfirst( $key ) );
+ $this->mExtensionMessages[$lang][$lckey] = $value;
}
/**
@@ -800,6 +803,7 @@ class MessageCache {
*/
function loadMessagesFile( $filename, $langcode = false ) {
global $wgLang, $wgContLang;
+ wfProfileIn( __METHOD__ );
$messages = $magicWords = false;
require( $filename );
@@ -822,6 +826,7 @@ class MessageCache {
global $wgContLang;
$wgContLang->addMagicWordsByLang( $magicWords );
}
+ wfProfileOut( __METHOD__ );
}
/**
@@ -831,6 +836,7 @@ class MessageCache {
* @param string $langcode Language code to process.
*/
function processMessagesArray( $messages, $langcode ) {
+ wfProfileIn( __METHOD__ );
$fallbackCode = $langcode;
$mergedMessages = array();
do {
@@ -842,6 +848,7 @@ class MessageCache {
if ( !empty($mergedMessages) )
$this->addMessages( $mergedMessages, $langcode );
+ wfProfileOut( __METHOD__ );
}
public function figureMessage( $key ) {