}
if ( !$skip ) {
- $a = array( 'name' => $message );
+ $a = array(
+ 'name' => $message,
+ 'normalizedname' => MessageCache::normalizeKey( $message ),
+ );
+
$args = array();
if ( isset( $params['args'] ) && count( $params['args'] ) != 0 ) {
$args = $params['args'];
self::$instance = null;
}
+ /**
+ * Normalize message key input
+ *
+ * @param string $key Input message key to be normalized
+ * @return string Normalized message key
+ */
+ public static function normalizeKey( $key ) {
+ $lckey = strtr( $key, ' ', '_' );
+ if ( ord( $lckey ) < 128 ) {
+ $lckey[0] = strtolower( $lckey[0] );
+ } else {
+ $lckey = $wgContLang->lcfirst( $lckey );
+ }
+
+ return $lckey;
+ }
+
/**
* @param BagOStuff $memCached A cache instance. If none, fall back to CACHE_NONE.
* @param bool $useDB
}
// Normalise title-case input (with some inlining)
- $lckey = strtr( $key, ' ', '_' );
- if ( ord( $lckey ) < 128 ) {
- $lckey[0] = strtolower( $lckey[0] );
- } else {
- $lckey = $wgContLang->lcfirst( $lckey );
- }
+ $lckey = MessageCache::normalizeKey( $key );
Hooks::run( 'MessageCache::get', array( &$lckey ) );