r2976 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r2975‎ | r2976 | r2977 >
Date:10:38, 5 April 2004
Author:timstarling
Status:old
Tags:
Comment:
Added transformation to wfMsg output, allowing tags such as {{SITENAME}} and {{localurl:Special:Preferences}} in the language files and MediaWiki namespace
Modified paths:
  • /trunk/phase3/includes/MessageCache.php (modified) (history)
  • /trunk/phase3/includes/Namespace.php (modified) (history)
  • /trunk/phase3/includes/Parser.php (modified) (history)
  • /trunk/phase3/includes/Title.php (modified) (history)
  • /trunk/phase3/languages/Language.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Title.php
@@ -85,6 +85,9 @@
8686 $t->mDefaultNamespace = $defaultNamespace;
8787
8888 wfProfileOut( $fname );
 89+ if ( !is_object( $t ) ) {
 90+ var_dump( debug_backtrace() );
 91+ }
8992 if( $t->secureAndSplit() ) {
9093 return $t;
9194 } else {
@@ -628,7 +631,12 @@
629632 if ( preg_match( "/^((?:i|x|[a-z]{2,3})(?:-[a-z0-9]+)?|[A-Za-z0-9_\\x80-\\xff]+?)_*:_*(.*)$/", $t, $m ) ) {
630633 #$p = strtolower( $m[1] );
631634 $p = $m[1];
632 - if ( $ns = $wgLang->getNsIndex( strtolower( $p ) )) {
 635+ $lowerNs = strtolower( $p );
 636+ if ( $ns = Namespace::getCanonicalIndex( $lowerNs ) ) {
 637+ # Canonical namespace
 638+ $t = $m[2];
 639+ $this->mNamespace = $ns;
 640+ } elseif ( $ns = $wgLang->getNsIndex( $lowerNs )) {
633641 # Ordinary namespace
634642 $t = $m[2];
635643 $this->mNamespace = $ns;
Index: trunk/phase3/includes/Namespace.php
@@ -26,6 +26,26 @@
2727 define("NS_HELP", 12);
2828 define("NS_HELP_TALK", 13);
2929
 30+# These are synonyms for the names given in the language file
 31+# Users and translators should not change them
 32+/* private */ $wgCanonicalNamespaceNames = array(
 33+ NS_MEDIA => "Media",
 34+ NS_SPECIAL => "Special",
 35+ NS_TALK => "Talk",
 36+ NS_USER => "User",
 37+ NS_USER_TALK => "User_talk",
 38+ NS_WIKIPEDIA => "Wikipedia",
 39+ NS_WIKIPEDIA_TALK => "Wikipedia_talk",
 40+ NS_IMAGE => "Image",
 41+ NS_IMAGE_TALK => "Image_talk",
 42+ NS_MEDIAWIKI => "MediaWiki",
 43+ NS_MEDIAWIKI_TALK => "MediaWiki_talk",
 44+ NS_TEMPLATE => "Template",
 45+ NS_TEMPLATE_TALK => "Template_talk",
 46+ NS_HELP => "Help",
 47+ NS_HELP_TALK => "Help_talk"
 48+);
 49+
3050 class Namespace {
3151
3252 /* These functions are deprecated */
@@ -71,6 +91,32 @@
7292 return $index;
7393 }
7494 }
 95+
 96+ # Returns the canonical (English Wikipedia) name for a given index
 97+ function &getCanonicalName( $index )
 98+ {
 99+ global $wgCanonicalNamespaceNames;
 100+ return $wgCanonicalNamespaceNames[$index];
 101+ }
 102+
 103+ # Returns the index for a given canonical name, or NULL
 104+ # The input *must* be converted to lower case first
 105+ function &getCanonicalIndex( $name )
 106+ {
 107+ global $wgCanonicalNamespaceNames;
 108+ static $xNamespaces = false;
 109+ if ( $xNamespaces === false ) {
 110+ $xNamespaces = array();
 111+ foreach ( $wgCanonicalNamespaceNames as $i => $text ) {
 112+ $xNamespaces[strtolower($text)] = $i;
 113+ }
 114+ }
 115+ if ( array_key_exists( $name, $xNamespaces ) ) {
 116+ return $xNamespaces[$name];
 117+ } else {
 118+ return NULL;
 119+ }
 120+ }
75121 }
76122
77123 ?>
Index: trunk/phase3/includes/MessageCache.php
@@ -10,7 +10,7 @@
1111 class MessageCache
1212 {
1313 var $mCache, $mUseCache, $mDisable, $mExpiry;
14 - var $mMemcKey, $mKeys;
 14+ var $mMemcKey, $mKeys, $mParserOptions, $mParser;
1515
1616 var $mInitialised = false;
1717
@@ -21,7 +21,9 @@
2222 $this->mMemcKey = "$memcPrefix:messages";
2323 $this->mKeys = false; # initialised on demand
2424 $this->mInitialised = true;
25 -
 25+ $this->mParserOptions = ParserOptions::newFromUser( $u=NULL );
 26+ $this->mParser = new Parser;
 27+
2628 $this->load();
2729 }
2830
@@ -157,7 +159,7 @@
158160 }
159161
160162 if ( $this->mDisable ) {
161 - return $wgLang->getMessage( $key );
 163+ return $this->transform( $wgLang->getMessage( $key ) );
162164 }
163165 $title = $wgLang->ucfirst( $key );
164166
@@ -192,9 +194,20 @@
193195 if ( !$message ) {
194196 $message = "<$key>";
195197 }
 198+
 199+ # Replace brace tags
 200+ $message = $this->transform( $message );
 201+
196202 return $message;
197203 }
198204
 205+ function transform( $message ) {
 206+ if ( strstr( $message, "{{" ) !== false ) {
 207+ $message = $this->mParser->transformMsg( $message, $this->mParserOptions );
 208+ }
 209+ return $message;
 210+ }
 211+
199212 function disable() { $this->mDisable = true; }
200213 function enable() { $this->mDisable = false; }
201214
Index: trunk/phase3/includes/Parser.php
@@ -41,6 +41,7 @@
4242 # Allowed values for $mOutputType
4343 define( "OT_HTML", 1 );
4444 define( "OT_WIKI", 2 );
 45+define( "OT_MSG", 3 );
4546
4647 class Parser
4748 {
@@ -1077,7 +1078,7 @@
10781079 }
10791080
10801081 function getVariableValue( $index ) {
1081 - global $wgLang;
 1082+ global $wgLang, $wgSitename, $wgServer;
10821083
10831084 switch ( $index ) {
10841085 case MAG_CURRENTMONTH:
@@ -1096,6 +1097,10 @@
10971098 return $wgLang->time( wfTimestampNow(), false );
10981099 case MAG_NUMBEROFARTICLES:
10991100 return wfNumberOfArticles();
 1101+ case MAG_SITENAME:
 1102+ return $wgSitename;
 1103+ case MAG_SERVER:
 1104+ return $wgServer;
11001105 default:
11011106 return NULL;
11021107 }
@@ -1124,7 +1129,7 @@
11251130 $this->initialiseVariables();
11261131 }
11271132 $titleChars = Title::legalChars();
1128 - $regex = "/{{([$titleChars]*?)}}/s";
 1133+ $regex = "/{{([$titleChars\\|]*?)}}/s";
11291134
11301135 # "Recursive" variable expansion: run it through a couple of passes
11311136 for ( $i=0; $i<MAX_INCLUDE_REPEAT && !$bail; $i++ ) {
@@ -1170,7 +1175,7 @@
11711176
11721177 function braceSubstitution( $matches )
11731178 {
1174 - global $wgLinkCache;
 1179+ global $wgLinkCache, $wgLang;
11751180 $fname = "Parser::braceSubstitution";
11761181 $found = false;
11771182 $nowiki = false;
@@ -1180,7 +1185,7 @@
11811186 # SUBST
11821187 $mwSubst =& MagicWord::get( MAG_SUBST );
11831188 if ( $mwSubst->matchStartAndRemove( $text ) ) {
1184 - if ( $this->mOutputType == OT_HTML ) {
 1189+ if ( $this->mOutputType != OT_WIKI ) {
11851190 # Invalid SUBST not replaced at PST time
11861191 # Return without further processing
11871192 $text = $matches[0];
@@ -1192,7 +1197,7 @@
11931198 $found = true;
11941199 }
11951200
1196 - # Various prefixes
 1201+ # MSG, MSGNW and INT
11971202 if ( !$found ) {
11981203 # Check for MSGNW:
11991204 $mwMsgnw =& MagicWord::get( MAG_MSGNW );
@@ -1211,7 +1216,55 @@
12121217 $found = true;
12131218 }
12141219 }
 1220+
 1221+ # NS
 1222+ if ( !$found ) {
 1223+ # Check for NS: (namespace expansion)
 1224+ $mwNs = MagicWord::get( MAG_NS );
 1225+ if ( $mwNs->matchStartAndRemove( $text ) ) {
 1226+ if ( intval( $text ) ) {
 1227+ $text = $wgLang->getNsText( intval( $text ) );
 1228+ $found = true;
 1229+ } else {
 1230+ $index = Namespace::getCanonicalIndex( strtolower( $text ) );
 1231+ if ( !is_null( $index ) ) {
 1232+ $text = $wgLang->getNsText( $index );
 1233+ $found = true;
 1234+ }
 1235+ }
 1236+ }
 1237+ }
12151238
 1239+ # LOCALURL and LOCALURLE
 1240+ if ( !$found ) {
 1241+ $mwLocal = MagicWord::get( MAG_LOCALURL );
 1242+ $mwLocalE = MagicWord::get( MAG_LOCALURLE );
 1243+
 1244+ if ( $mwLocal->matchStartAndRemove( $text ) ) {
 1245+ $func = 'getLocalURL';
 1246+ } elseif ( $mwLocalE->matchStartAndRemove( $text ) ) {
 1247+ $func = 'escapeLocalURL';
 1248+ } else {
 1249+ $func = '';
 1250+ }
 1251+
 1252+ if ( $func !== '' ) {
 1253+ $args = explode( "|", $text );
 1254+ $n = count( $args );
 1255+ if ( $n > 0 ) {
 1256+ $title = Title::newFromText( $args[0] );
 1257+ if ( !is_null( $title ) ) {
 1258+ if ( $n > 1 ) {
 1259+ $text = $title->$func( $args[1] );
 1260+ } else {
 1261+ $text = $title->$func();
 1262+ }
 1263+ $found = true;
 1264+ }
 1265+ }
 1266+ }
 1267+ }
 1268+
12161269 # Check for a match against internal variables
12171270 if ( !$found && array_key_exists( $text, $this->mVariables ) ) {
12181271 $text = $this->mVariables[$text];
@@ -1741,6 +1794,26 @@
17421795 $this->clearState();
17431796 }
17441797 }
 1798+
 1799+ function transformMsg( $text, $options ) {
 1800+ global $wgTitle;
 1801+ static $executing = false;
 1802+
 1803+ # Guard against infinite recursion
 1804+ if ( $executing ) {
 1805+ return $text;
 1806+ }
 1807+ $executing = true;
 1808+
 1809+ $this->mTitle = $wgTitle;
 1810+ $this->mOptions = $options;
 1811+ $this->mOutputType = OT_MSG;
 1812+ $this->clearState();
 1813+ $text = $this->replaceVariables( $text );
 1814+
 1815+ $executing = false;
 1816+ return $text;
 1817+ }
17451818 }
17461819
17471820 class ParserOutput
@@ -1825,6 +1898,7 @@
18261899
18271900 if ( !$userInput ) {
18281901 $user = new User;
 1902+ $user->setLoaded( true );
18291903 } else {
18301904 $user =& $userInput;
18311905 }
Index: trunk/phase3/languages/Language.php
@@ -40,6 +40,11 @@
4141 define("MAG_IMG_CENTER", 21);
4242 define("MAG_INT", 22);
4343 define("MAG_FORCETOC", 23);
 44+define("MAG_SITENAME", 24);
 45+define("MAG_NS", 25);
 46+define("MAG_LOCALURL", 26);
 47+define("MAG_LOCALURLE", 27);
 48+define("MAG_SERVER", 28);
4449
4550 $wgVariableIDs = array(
4651 MAG_CURRENTMONTH,
@@ -49,7 +54,9 @@
5055 MAG_CURRENTYEAR,
5156 MAG_CURRENTTIME,
5257 MAG_NUMBEROFARTICLES,
53 - MAG_CURRENTMONTHNAMEGEN
 58+ MAG_CURRENTMONTHNAMEGEN,
 59+ MAG_SITENAME,
 60+ MAG_SERVER
5461 );
5562
5663
@@ -410,8 +417,12 @@
411418 MAG_IMG_NONE => array( 1, "none" ),
412419 MAG_IMG_WIDTH => array( 1, "$1px" ),
413420 MAG_IMG_CENTER => array( 1, "center", "centre" ),
414 - MAG_INT => array( 0, "INT:" )
415 -
 421+ MAG_INT => array( 0, "INT:" ),
 422+ MAG_SITENAME => array( 1, "SITENAME" ),
 423+ MAG_NS => array( 0, "NS:" ),
 424+ MAG_LOCALURL => array( 0, "LOCALURL:" ),
 425+ MAG_LOCALURLE => array( 0, "LOCALURLE:" ),
 426+ MAG_SERVER => array( 0, "SERVER" )
416427 );
417428
418429 # All special pages have to be listed here: a description of ""
@@ -438,7 +449,7 @@
439450 "Longpages" => "Long articles",
440451 "Newpages" => "Newly created articles",
441452 "Ancientpages" => "Oldest articles",
442 - "Deadendpages" => "Dead-end pages",
 453+ "Deadendpages" => "Dead-end pages",
443454 # "Intl" => "Interlanguage Links",
444455 "Allpages" => "All pages by title",
445456
@@ -492,19 +503,19 @@
493504 "mainpage" => "Main Page",
494505 "mainpagetext" => "Wiki software successfully installed.",
495506 "about" => "About",
496 -"aboutwikipedia" => "About $wgSitename",
497 -"aboutpage" => "$wgMetaNamespace:About",
 507+"aboutwikipedia" => "About {{SITENAME}}",
 508+"aboutpage" => "{{ns:4}}:About",
498509 'article' => 'Article',
499510 "help" => "Help",
500 -"helppage" => $wgNamespaceNamesEn[NS_HELP].":Contents",
501 -"wikititlesuffix" => "$wgSitename",
 511+"helppage" => "{{ns:12}}:Contents",
 512+"wikititlesuffix" => "{{SITENAME}}",
502513 "bugreports" => "Bug reports",
503 -"bugreportspage" => "$wgMetaNamespace:Bug_reports",
 514+"bugreportspage" => "{{ns:4}}:Bug_reports",
504515 "sitesupport" => "Donations", # Set a URL in $wgSiteSupportPage in LocalSettings.php
505516 "faq" => "FAQ",
506 -"faqpage" => "$wgMetaNamespace:FAQ",
 517+"faqpage" => "{{ns:4}}:FAQ",
507518 "edithelp" => "Editing help",
508 -"edithelppage" => $wgNamespaceNamesEn[NS_HELP].":Editing",
 519+"edithelppage" => "{{ns:12}}:Editing",
509520 "cancel" => "Cancel",
510521 "qbfind" => "Find",
511522 "qbbrowse" => "Browse",
@@ -519,10 +530,10 @@
520531 'navigation' => 'Navigation',
521532 "currentevents" => "Current events",
522533 "disclaimers" => "Disclaimers",
523 -"disclaimerpage" => "$wgMetaNamespace:General_disclaimer",
 534+"disclaimerpage" => "{{ns:4}}:General_disclaimer",
524535 "errorpagetitle" => "Error",
525536 "returnto" => "Return to $1.",
526 -"fromwikipedia" => "From $wgSitename, the free encyclopedia.",
 537+"fromwikipedia" => "From {{SITENAME}}, the free encyclopedia.",
527538 "whatlinkshere" => "Pages that link here",
528539 "help" => "Help",
529540 "search" => "Search",
@@ -555,10 +566,10 @@
556567 "redirectedfrom" => "(Redirected from $1)",
557568 "lastmodified" => "This page was last modified $1.",
558569 "viewcount" => "This page has been accessed $1 times.",
559 -"gnunote" => "All text is available under the terms of the <a class='internal' href='$wgScriptPath/index.php/GNU_Free_Documentation_License'>GNU Free Documentation License</a>. $wgSitename is powered by <a href='http://www.mediawiki.org/' class='external'>MediaWiki</a>, an open source wiki engine.",
560 -"printsubtitle" => "(From $wgServer)",
 570+"gnunote" => "All text is available under the terms of the <a class='internal' href='{{localurl:GNU_Free_Documentation_License}}'>GNU Free Documentation License</a>. $wgSitename is powered by <a href='http://www.mediawiki.org/' class='external'>MediaWiki</a>, an open source wiki engine.",
 571+"printsubtitle" => "(From {{SERVER}})",
561572 "protectedpage" => "Protected page",
562 -"administrators" => "$wgMetaNamespace:Administrators",
 573+"administrators" => "{{ns:4}}:Administrators",
563574 "sysoptitle" => "Sysop access required",
564575 "sysoptext" => "The action you have requested can only be
565576 performed by users with \"sysop\" status.
@@ -573,7 +584,7 @@
574585 "nbytes" => "$1 bytes",
575586 "go" => "Go",
576587 "ok" => "OK",
577 -"sitetitle" => "$wgSitename",
 588+"sitetitle" => "{{SITENAME}}",
578589 "sitesubtitle" => "The Free Encyclopedia",
579590 "retrievedfrom" => "Retrieved from \"$1\"",
580591 "newmessages" => "You have $1.",
@@ -652,7 +663,7 @@
653664 "viewsource" => "View source",
654665 "protectedtext" => "This page has been locked to prevent editing; there are
655666 a number of reasons why this may be so, please see
656 -[[$wgMetaNamespace:Protected page]].
 667+[[{{ns:4}}:Protected page]].
657668
658669 You can view and copy the source of this page:",
659670
@@ -660,13 +671,13 @@
661672 #
662673 "logouttitle" => "User logout",
663674 "logouttext" => "You are now logged out.
664 -You can continue to use $wgSitename anonymously, or you can log in
 675+You can continue to use {{SITENAME}} anonymously, or you can log in
665676 again as the same or as a different user. Note that some pages may
666677 continue to be displayed as if you were still logged in, until you clear
667678 your browser cache\n",
668679
669680 "welcomecreation" => "<h2>Welcome, $1!</h2><p>Your account has been created.
670 -Don't forget to change your $wgSitename preferences.",
 681+Don't forget to change your {{SITENAME}} preferences.",
671682
672683 "loginpagetitle" => "User login",
673684 "yourname" => "Your user name",
@@ -678,7 +689,7 @@
679690 "alreadyloggedin" => "<font color=red><b>User $1, you are already logged in!</b></font><br />\n",
680691
681692 "login" => "Log in",
682 -"loginprompt" => "You must have cookies enabled to log in to $wgSitename.",
 693+"loginprompt" => "You must have cookies enabled to log in to {{SITENAME}}.",
683694 "userlogin" => "Log in",
684695 "logout" => "Log out",
685696 "userlogout" => "Log out",
@@ -694,18 +705,18 @@
695706 email address to them, and it also helps you if you forget your
696707 password.",
697708 "loginerror" => "Login error",
698 -"nocookiesnew" => "The user account was created, but you are not logged in. $wgSitename uses cookies to log in users. You have cookies disabled. Please enable them, then log in with your new username and password.",
699 -"nocookieslogin" => "$wgSitename uses cookies to log in users. You have cookies disabled. Please enable them and try again.",
 709+"nocookiesnew" => "The user account was created, but you are not logged in. {{SITENAME}} uses cookies to log in users. You have cookies disabled. Please enable them, then log in with your new username and password.",
 710+"nocookieslogin" => "{{SITENAME}} uses cookies to log in users. You have cookies disabled. Please enable them and try again.",
700711 "noname" => "You have not specified a valid user name.",
701712 "loginsuccesstitle" => "Login successful",
702 -"loginsuccess" => "You are now logged in to $wgSitename as \"$1\".",
 713+"loginsuccess" => "You are now logged in to {{SITENAME}} as \"$1\".",
703714 "nosuchuser" => "There is no user by the name \"$1\".
704715 Check your spelling, or use the form below to create a new user account.",
705716 "wrongpassword" => "The password you entered is incorrect. Please try again.",
706717 "mailmypassword" => "Mail me a new password",
707 -"passwordremindertitle" => "Password reminder from $wgSitename",
 718+"passwordremindertitle" => "Password reminder from {{SITENAME}}",
708719 "passwordremindertext" => "Someone (probably you, from IP address $1)
709 -requested that we send you a new $wgSitename login password.
 720+requested that we send you a new {{SITENAME}} login password.
710721 The password for user \"$2\" is now \"$3\".
711722 You should log in and change your password now.",
712723 "noemail" => "There is no e-mail address recorded for user \"$1\".",
@@ -752,7 +763,7 @@
753764 "blockedtitle" => "User is blocked",
754765 "blockedtext" => "Your user name or IP address has been blocked by $1.
755766 The reason given is this:<br />''$2''<p>You may contact $1 or one of the other
756 -[[$wgMetaNamespace:Administrators|administrators]] to discuss the block.
 767+[[{{ns4}}:Administrators|administrators]] to discuss the block.
757768
758769 Note that you may not use the \"email this user\" feature unless you have a valid email address registered in your [[Special:Preferences|user preferences]].
759770
@@ -772,7 +783,7 @@
773784 "newarticletext" =>
774785 "You've followed a link to a page that doesn't exist yet.
775786 To create the page, start typing in the box below
776 -(see the [[$wgMetaNamespace:Help|help page]] for more info).
 787+(see the [[{{ns:4}}:Help|help page]] for more info).
777788 If you are here by mistake, just click your browser's '''back''' button.",
778789 "talkpagetext" => "<!-- MediaWiki:talkpagetext -->",
779790 "anontalkpagetext" => "---- ''This is the discussion page for an anonymous user who has not created an account yet or who does not use it. We therefore have to use the numerical [[IP address]] to identify him/her. Such an IP address can be shared by several users. If you are an anonymous user and feel that irrelevant comments have been directed at you, please [[Special:Userlogin|create an account or log in]] to avoid future confusion with other anonymous users.'' ",
@@ -800,7 +811,7 @@
801812 If you save it, any changes made since this revision will be lost.</strong>\n",
802813 "yourdiff" => "Differences",
803814 # FIXME: This is inappropriate for third-party use!
804 -"copyrightwarning" => "Please note that all contributions to $wgSitename are
 815+"copyrightwarning" => "Please note that all contributions to {{SITENAME}} are
805816 considered to be released under the GNU Free Documentation License
806817 (see $1 for details).
807818 If you don't want your writing to be edited mercilessly and redistributed
@@ -816,7 +827,7 @@
817828 the text into a text file and save it for later.",
818829 "protectedpagewarning" => "WARNING: This page has been locked so that only
819830 users with sysop privileges can edit it. Be sure you are following the
820 -<a href='$wgScriptPath/$wgMetaNamespace:Protected_page_guidelines'>protected page
 831+<a href='$wgScriptPath/{{ns:4}}:Protected_page_guidelines'>protected page
821832 guidelines</a>.",
822833
823834 # History pages
@@ -846,9 +857,9 @@
847858 # Search results
848859 #
849860 "searchresults" => "Search results",
850 -"searchhelppage" => "$wgMetaNamespace:Searching",
851 -"searchingwikipedia" => "Searching $wgSitename",
852 -"searchresulttext" => "For more information about searching $wgSitename, see $1.",
 861+"searchhelppage" => "{{ns:4}}:Searching",
 862+"searchingwikipedia" => "Searching {{SITENAME}}",
 863+"searchresulttext" => "For more information about searching {{SITENAME}}, see $1.",
853864 "searchquery" => "For query \"$1\"",
854865 "badquery" => "Badly formed search query",
855866 "badquerytext" => "We could not process your query.
@@ -891,7 +902,7 @@
892903 <INPUT TYPE=text name=q size=31 maxlength=255 value=\"$1\">
893904 <INPUT type=submit name=btnG VALUE=\"Google Search\">
894905 <font size=-1>
895 -<input type=hidden name=domains value=\"{$wgServer}\"><br /><input type=radio name=sitesearch value=\"\"> WWW <input type=radio name=sitesearch value=\"{$wgServer}\" checked> {$wgServer} <br />
 906+<input type=hidden name=domains value=\"{{SERVER}}\"><br /><input type=radio name=sitesearch value=\"\"> WWW <input type=radio name=sitesearch value=\"{{SERVER}}\" checked> {{SERVER}} <br />
896907 <input type='hidden' name='ie' value='$2'>
897908 <input type='hidden' name='oe' value='$2'>
898909 </font>
@@ -904,13 +915,12 @@
905916 #
906917 "preferences" => "Preferences",
907918 "prefsnologin" => "Not logged in",
908 -"prefsnologintext" => "You must be <a href=\"" .
909 - wfLocalUrl( "Special:Userlogin" ) . "\">logged in</a>
 919+"prefsnologintext" => "You must be <a href=\"{{localurl:Special:Userlogin}}\">logged in</a>
910920 to set user preferences.",
911921 "prefslogintext" => "You are logged in as \"$1\".
912922 Your internal ID number is $2.
913923
914 -See [[$wgMetaNamespace:User preferences help]] for help deciphering the options.",
 924+See [[{{ns:4}}:User preferences help]] for help deciphering the options.",
915925 "prefsreset" => "Preferences have been reset from storage.",
916926 "qbsettings" => "Quickbar settings",
917927 "changepassword" => "Change password",
@@ -983,23 +993,20 @@
984994 "reupload" => "Re-upload",
985995 "reuploaddesc" => "Return to the upload form.",
986996 "uploadnologin" => "Not logged in",
987 -"uploadnologintext" => "You must be <a href=\"" .
988 - wfLocalUrl( "Special:Userlogin" ) . "\">logged in</a>
 997+"uploadnologintext" => "You must be <a href=\"{{localurl:Special:Userlogin}}\">logged in</a>
989998 to upload files.",
990999 "uploadfile" => "Upload images, sounds, documents etc.",
9911000 "uploaderror" => "Upload error",
9921001 "uploadtext" => "<strong>STOP!</strong> Before you upload here,
993 -make sure to read and follow the <a href=\"" .
994 -wfLocalUrlE( "$wgMetaNamespace:Image_use_policy" ) . "\">image use policy</a>.
 1002+make sure to read and follow the <a href=\"{{localurle:Special:Image_use_policy}}\">image use policy</a>.
9951003 <p>If a file with the name you are specifying already
9961004 exists on the wiki, it'll be replaced without warning.
9971005 So unless you mean to update a file, it's a good idea
9981006 to first check if such a file exists.
9991007 <p>To view or search previously uploaded images,
1000 -go to the <a href=\"" . wfLocalUrlE( "Special:Imagelist" ) .
1001 -"\">list of uploaded images</a>.
1002 -Uploads and deletions are logged on the <a href=\"" .
1003 -wfLocalUrlE( "$wgMetaNamespace:Upload_log" ) . "\">upload log</a>.
 1008+go to the <a href=\"{{localurle:Special:Imagelist}}\">list of uploaded images</a>.
 1009+Uploads and deletions are logged on the " .
 1010+"<a href=\"{{localurle:Wikipedia:Upload_log}}\">upload log</a>.
10041011 <p>Use the form below to upload new image files for use in
10051012 illustrating your articles.
10061013 On most browsers, you will see a \"Browse...\" button, which will
@@ -1033,8 +1040,8 @@
10341041 "filesource" => "Source",
10351042 "affirmation" => "I affirm that the copyright holder of this file
10361043 agrees to license it under the terms of the $1.",
1037 -"copyrightpage" => "$wgMetaNamespace:Copyrights",
1038 -"copyrightpagename" => "$wgSitename copyright",
 1044+"copyrightpage" => "{{ns:4}}:Copyrights",
 1045+"copyrightpagename" => "{{SITENAME}} copyright",
10391046 "uploadedfiles" => "Uploaded files",
10401047 "noaffirmation" => "You must affirm that your upload does not violate
10411048 any copyrights.",
@@ -1084,7 +1091,7 @@
10851092 "sitestats" => "Site statistics",
10861093 "userstats" => "User statistics",
10871094 "sitestatstext" => "There are <b>$1</b> total pages in the database.
1088 -This includes \"talk\" pages, pages about $wgSitename, minimal \"stub\"
 1095+This includes \"talk\" pages, pages about {{SITENAME}}, minimal \"stub\"
10891096 pages, redirects, and others that probably don't qualify as articles.
10901097 Excluding those, there are <b>$2</b> pages that are probably legitimate
10911098 articles.<p>
@@ -1100,7 +1107,7 @@
11011108 "maintnancepagetext" => "This page includes several handy tools for everyday maintenance. Some of these functions tend to stress the database, so please do not hit reload after every item you fixed ;-)",
11021109 "maintenancebacklink" => "Back to Maintenance Page",
11031110 "disambiguations" => "Disambiguation pages",
1104 -"disambiguationspage" => "$wgMetaNamespace:Links_to_disambiguating_pages",
 1111+"disambiguationspage" => "{{ns:4}}:Links_to_disambiguating_pages",
11051112 "disambiguationstext" => "The following articles link to a <i>disambiguation page</i>. They should link to the appropriate topic instead.<br />A page is treated as dismbiguation if it is linked from $1.<br />Links from other namespaces are <i>not</i> listed here.",
11061113 "doubleredirects" => "Double Redirects",
11071114 "doubleredirectstext" => "<b>Attention:</b> This list may contain false positives. That usually means there is additional text with links below the first #REDIRECT.<br />\nEach row contains links to the first and second redirect, as well as the first line of the second redirect text, usually giving the \"real\" taget article, which the first redirect should point to.",
@@ -1152,7 +1159,7 @@
11531160 "booksourcetext" => "Below is a list of links to other sites that
11541161 sell new and used books, and may also have further information
11551162 about books you are looking for.
1156 -$wgSitename is not affiliated with any of these businesses, and
 1163+{{SITENAME}} is not affiliated with any of these businesses, and
11571164 this list should not be construed as an endorsement.",
11581165 "rfcurl" => "http://www.faqs.org/rfcs/rfc$1.html",
11591166 "alphaindexline" => "$1 to $2",
@@ -1161,10 +1168,8 @@
11621169 # Email this user
11631170 #
11641171 "mailnologin" => "No send address",
1165 -"mailnologintext" => "You must be <a href=\"" .
1166 - wfLocalUrl( "Special:Userlogin" ) . "\">logged in</a>
1167 -and have a valid e-mail address in your <a href=\"" .
1168 - wfLocalUrl( "Special:Preferences" ) . "\">preferences</a>
 1172+"mailnologintext" => "You must be <a href=\"{{localurl:Special:Userlogin\">logged in</a>
 1173+and have a valid e-mail address in your <a href=\"{{localurl:Special:Preferences}}\">preferences</a>
11691174 to send e-mail to other users.",
11701175 "emailuser" => "E-mail this user",
11711176 "emailpage" => "E-mail user",
@@ -1174,7 +1179,7 @@
11751180 as the \"From\" address of the mail, so the recipient will be able
11761181 to reply.",
11771182 "usermailererror" => "Mail object returned error: ",
1178 -"defemailsubject" => "$wgSitename e-mail",
 1183+"defemailsubject" => "{{SITENAME}} e-mail",
11791184 "noemailtitle" => "No e-mail address",
11801185 "noemailtext" => "This user has not specified a valid e-mail address,
11811186 or has chosen not to receive e-mail from other users.",
@@ -1192,15 +1197,12 @@
11931198 "watchlistsub" => "(for user \"$1\")",
11941199 "nowatchlist" => "You have no items on your watchlist.",
11951200 "watchnologin" => "Not logged in",
1196 -"watchnologintext" => "You must be <a href=\"" .
1197 - wfLocalUrl( "Special:Userlogin" ) . "\">logged in</a>
 1201+"watchnologintext" => "You must be <a href=\"{{localurl:Special:Userlogin}}\">logged in</a>
11981202 to modify your watchlist.",
11991203 "addedwatch" => "Added to watchlist",
1200 -"addedwatchtext" => "The page \"$1\" has been added to your <a href=\"" .
1201 - wfLocalUrl( "Special:Watchlist" ) . "\">watchlist</a>.
 1204+"addedwatchtext" => "The page \"$1\" has been added to your <a href=\"{{localurl:Special:Watchlist}}\">watchlist</a>.
12021205 Future changes to this page and its associated Talk page will be listed there,
1203 -and the page will appear <b>bolded</b> in the <a href=\"" .
1204 - wfLocalUrl( "Special:Recentchanges" ) . "\">list of recent changes</a> to
 1206+and the page will appear <b>bolded</b> in the <a href=\"{{localurl:Special:Recentchanges}}\">list of recent changes</a> to
12051207 make it easier to pick out.</p>
12061208
12071209 <p>If you want to remove the page from your watchlist later, click \"Stop watching\" in the sidebar.",
@@ -1246,7 +1248,7 @@
12471249 or image along with all of its history from the database.
12481250 Please confirm that you intend to do this, that you understand the
12491251 consequences, and that you are doing this in accordance with
1250 -[[$wgMetaNamespace:Policy]].",
 1252+[[{{ns:4}}:Policy]].",
12511253 "confirmcheck" => "Yes, I really want to delete this.",
12521254 "actioncomplete" => "Action complete",
12531255 "deletedtext" => "\"$1\" has been deleted.
@@ -1276,7 +1278,7 @@
12771279 "revertpage" => "Reverted edit of $2, changed back to last version by $1",
12781280 "protectlogpage" => "Protection_log",
12791281 "protectlogtext" => "Below is a list of page locks/unlocks.
1280 -See [[$wgMetaNamespace:Protected page]] for more information.",
 1282+See [[{{ns:4}}:Protected page]] for more information.",
12811283 "protectedarticle" => "protected [[$1]]",
12821284 "unprotectedarticle" => "unprotected [[$1]]",
12831285
@@ -1295,7 +1297,7 @@
12961298 "undeletebtn" => "Restore!",
12971299 "undeletedarticle" => "restored \"$1\"",
12981300 "undeletedtext" => "The article [[$1]] has been successfully restored.
1299 -See [[$wgMetaNamespace:Deletion_log]] for a record of recent deletions and restorations.",
 1301+See [[{{ns:4}}:Deletion_log]] for a record of recent deletions and restorations.",
13001302
13011303 # Contributions
13021304 #
@@ -1324,7 +1326,7 @@
13251327 "blockiptext" => "Use the form below to block write access
13261328 from a specific IP address or username.
13271329 This should be done only only to prevent vandalism, and in
1328 -accordance with [[$wgMetaNamespace:Policy|policy]].
 1330+accordance with [[{{ns:4}}:Policy|policy]].
13291331 Fill in a specific reason below (for example, citing particular
13301332 pages that were vandalized).",
13311333 "ipaddress" => "IP Address/username",
@@ -1444,8 +1446,7 @@
14451447 In those cases, you will have to move or merge the page manually if desired.",
14461448 "movearticle" => "Move page",
14471449 "movenologin" => "Not logged in",
1448 -"movenologintext" => "You must be a registered user and <a href=\"" .
1449 - wfLocalUrl( "Special:Userlogin" ) . "\">logged in</a>
 1450+"movenologintext" => "You must be a registered user and <a href=\"{{localurl:Special:Userlogin}}\">logged in</a>
14501451 to move a page.",
14511452 "newtitle" => "To new title",
14521453 "movepagebtn" => "Move page",
@@ -1540,7 +1541,7 @@
15411542 'tooltip-mainpage' => 'Visit the Main Page',
15421543 'tooltip-randompage' => 'Load a random page [alt-x]',
15431544 'tooltip-currentevents' => 'Find background information on current events',
1544 -'tooltip-sitesupport' => 'Support '.$wgSitename,
 1545+'tooltip-sitesupport' => 'Support {{SITENAME}}',
15451546 'tooltip-help' => 'The place to find out.',
15461547 'tooltip-recentchanges' => 'The list of recent changes in the wiki. [alt-r]',
15471548 'tooltip-recentchangeslinked' => 'Recent changes in pages linking to this page [alt-c]',

Status & tagging log