+ function fixVariableInNamespace( $talk ) {
+ if ( strpos( $talk, '$1' ) === false ) return $talk;
+
+ global $wgMetaNamespace;
+ $talk = str_replace( '$1', $wgMetaNamespace, $talk );
+
+ # Allow grammar transformations
+ # Allowing full message-style parsing would make simple requests
+ # such as action=raw much more expensive than they need to be.
+ # This will hopefully cover most cases.
+ $talk = preg_replace_callback( '/{{grammar:(.*?)\|(.*?)}}/i',
+ array( &$this, 'replaceGrammarInNamespace' ), $talk );
+ return str_replace( ' ', '_', $talk );
+ }
+