* Restored the {{msg:}} magic word, except now it's the wikisyntax
authorÆvar Arnfjörð Bjarmason <avar@users.mediawiki.org>
Mon, 23 May 2005 23:24:00 +0000 (23:24 +0000)
committerÆvar Arnfjörð Bjarmason <avar@users.mediawiki.org>
Mon, 23 May 2005 23:24:00 +0000 (23:24 +0000)
  representation of wfMsgForContent() rather than a shorthand for {{Template:}}

includes/MagicWord.php
includes/Parser.php

index 4c1f9a9..224facb 100644 (file)
@@ -24,33 +24,34 @@ define('MAG_CURRENTYEAR',           9);
 define('MAG_CURRENTTIME',              10);
 define('MAG_NUMBEROFARTICLES',         11);
 define('MAG_SUBST',                    12);
-define('MAG_MSGNW',                    13);
-define('MAG_NOEDITSECTION',            14);
-define('MAG_END',                      15);
-define('MAG_IMG_THUMBNAIL',            16);
-define('MAG_IMG_RIGHT',                        17);
-define('MAG_IMG_LEFT',                 18);
-define('MAG_IMG_NONE',                 19);
-define('MAG_IMG_WIDTH',                        20);
-define('MAG_IMG_CENTER',               21);
-define('MAG_INT',                      22);
-define('MAG_FORCETOC',                 23);
-define('MAG_SITENAME',                 24);
-define('MAG_NS',                       25);
-define('MAG_LOCALURL',                 26);
-define('MAG_LOCALURLE',                        27);
-define('MAG_SERVER',                   28);
-define('MAG_IMG_FRAMED',               29);
-define('MAG_PAGENAME',                 30);
-define('MAG_PAGENAMEE',                        31);
-define('MAG_NAMESPACE',                        32);
-define('MAG_TOC',                      33);
-define('MAG_GRAMMAR',                  34);
-define('MAG_NOTITLECONVERT',           35);
-define('MAG_NOCONTENTCONVERT',         36);
-define('MAG_CURRENTWEEK',              37);
-define('MAG_CURRENTDOW',               38);
-define('MAG_REVISIONID',               39);
+define('MAG_MSG',                      13);
+define('MAG_MSGNW',                    14);
+define('MAG_NOEDITSECTION',            15);
+define('MAG_END',                      16);
+define('MAG_IMG_THUMBNAIL',            17);
+define('MAG_IMG_RIGHT',                        18);
+define('MAG_IMG_LEFT',                 19);
+define('MAG_IMG_NONE',                 20);
+define('MAG_IMG_WIDTH',                        21);
+define('MAG_IMG_CENTER',               22);
+define('MAG_INT',                      23);
+define('MAG_FORCETOC',                 24);
+define('MAG_SITENAME',                 25);
+define('MAG_NS',                       26);
+define('MAG_LOCALURL',                 27);
+define('MAG_LOCALURLE',                        28);
+define('MAG_SERVER',                   29);
+define('MAG_IMG_FRAMED',               30);
+define('MAG_PAGENAME',                 31);
+define('MAG_PAGENAMEE',                        32);
+define('MAG_NAMESPACE',                        33);
+define('MAG_TOC',                      34);
+define('MAG_GRAMMAR',                  35);
+define('MAG_NOTITLECONVERT',           36);
+define('MAG_NOCONTENTCONVERT',         37);
+define('MAG_CURRENTWEEK',              38);
+define('MAG_CURRENTDOW',               39);
+define('MAG_REVISIONID',               40);
 
 $wgVariableIDs = array(
        MAG_CURRENTMONTH,
index 99e5c28..abd62c6 100644 (file)
@@ -2038,7 +2038,7 @@ class Parser
                                $nowiki = true;
                        }
 
-                       # Check if it is an internal message
+                       # int: is the wikitext equivalent of wfMsg()
                        $mwInt =& MagicWord::get( MAG_INT );
                        if ( $mwInt->matchStartAndRemove( $part1 ) ) {
                                if ( $this->incrementIncludeCount( 'int:'.$part1 ) ) {
@@ -2046,6 +2046,15 @@ class Parser
                                        $found = true;
                                }
                        }
+
+                       # msg: is the wikitext equivalent of wfMsgForContent()
+                       $mwMsg =& MagicWord::get( MAG_MSG );
+                       if ( $mwMsg->matchStartAndRemove( $part1 ) ) {
+                               if ( $this->incrementIncludeCount( 'msg:'.$part1 ) ) {
+                                        $text = $linestart . wfMsgReal( $part1, $args, true, true );
+                                        $found = true;
+                               }
+                       }
                }
 
                # NS