- function makePhp($messages) {
- global $wgLanguageCode;
- $txt = "\n\n".'$wgAllMessages'.ucfirst($wgLanguageCode).' = array('."\n";
- foreach( $messages as $key => $m ) {
- if(strtolower($wgLanguageCode) != 'en' and $m['msg'] == $m['enmsg'] ) {
- $txt .= '#';
- } elseif ($m['msg'] == '<'.$key.'>'){
- $m['msg'] = '';
- $comment = ' #empty';
- } else {
- $comment = '';
- }
- $txt .= "'".$key."' => \"".str_replace('"','\"',$m['msg'])."\",$comment\n";
+
+ $fname = "wfSpecialAllMessages";
+ wfProfileIn( $fname );
+
+ wfProfileIn( "$fname-setup");
+ $ot = $wgRequest->getText( 'ot' );
+
+ $navText = wfMsg( 'allmessagestext' );
+
+
+ $first = true;
+ $sortedArray = array_merge( $wgAllMessagesEn, $wgMessageCache->mExtensionMessages );
+ ksort( $sortedArray );
+ $messages = array();
+ $wgMessageCache->disableTransform();
+
+ foreach ( $sortedArray as $key => $enMsg ) {
+ $messages[$key]['enmsg'] = $enMsg;
+ $messages[$key]['statmsg'] = wfMsgNoDb( $key );
+ $messages[$key]['msg'] = wfMsg ( $key );
+ }
+
+ $wgMessageCache->enableTransform();
+ wfProfileOut( "$fname-setup" );
+
+ wfProfileIn( "$fname-output" );
+ if ($ot == 'php') {
+ $navText .= makePhp($messages);
+ $wgOut->addHTML('PHP | <a href="'.$wgTitle->escapeLocalUrl('ot=html').'">HTML</a><pre>'.htmlspecialchars($navText).'</pre>');
+ } else {
+ $wgOut->addHTML( '<a href="'.$wgTitle->escapeLocalUrl('ot=php').'">PHP</a> | HTML' );
+ $wgOut->addWikiText( $navText );
+ $wgOut->addHTML( makeHTMLText( $messages ) );
+ }
+ wfProfileOut( "$fname-output" );
+
+ wfProfileOut( $fname );
+}
+
+/**
+ *
+ */
+function makePhp($messages) {
+ global $wgLanguageCode;
+ $txt = "\n\n".'$wgAllMessages'.ucfirst($wgLanguageCode).' = array('."\n";
+ foreach( $messages as $key => $m ) {
+ if(strtolower($wgLanguageCode) != 'en' and $m['msg'] == $m['enmsg'] ) {
+ //if (strstr($m['msg'],"\n")) {
+ // $txt.='/* ';
+ // $comment=' */';
+ //} else {
+ // $txt .= '#';
+ // $comment = '';
+ //}
+ continue;
+ } elseif ($m['msg'] == '<'.$key.'>'){
+ $m['msg'] = '';
+ $comment = ' #empty';
+ } else {
+ $comment = '';