CINXE.COM
Module:Main - Wikimedia Foundation
<!DOCTYPE html> <html class="client-nojs" lang="en" dir="ltr"> <head> <meta charset="UTF-8"> <title>Module:Main - Wikimedia Foundation</title> <script>(function(){var className="client-js";var cookie=document.cookie.match(/(?:^|; )donatewikimwclientpreferences=([^;]+)/);if(cookie){cookie[1].split('%2C').forEach(function(pref){className=className.replace(new RegExp('(^| )'+pref.replace(/-clientpref-\w+$|[^\w-]+/g,'')+'-clientpref-\\w+( |$)'),'$1'+pref+'$2');});}document.documentElement.className=className;}());RLCONF={"wgBreakFrames":false,"wgSeparatorTransformTable":["",""],"wgDigitTransformTable":["",""],"wgDefaultDateFormat":"dmy","wgMonthNames":["","January","February","March","April","May","June","July","August","September","October","November","December"],"wgRequestId":"d062d59d-f09a-4c65-9302-c14db022b80c","wgCanonicalNamespace":"Module","wgCanonicalSpecialPageName":false,"wgNamespaceNumber":828,"wgPageName":"Module:Main","wgTitle":"Main","wgCurRevisionId":40487,"wgRevisionId":40487,"wgArticleId":7847,"wgIsArticle":true,"wgIsRedirect":false,"wgAction":"view","wgUserName":null,"wgUserGroups":["*"],"wgCategories":[], "wgPageViewLanguage":"en","wgPageContentLanguage":"en","wgPageContentModel":"Scribunto","wgRelevantPageName":"Module:Main","wgRelevantArticleId":7847,"wgIsProbablyEditable":false,"wgRelevantPageIsProbablyEditable":false,"wgRestrictionEdit":[],"wgRestrictionMove":[],"wgCiteReferencePreviewsActive":true,"wgMediaViewerOnClick":true,"wgMediaViewerEnabledByDefault":true,"wgVisualEditor":{"pageLanguageCode":"en","pageLanguageDir":"ltr","pageVariantFallbacks":"en"},"wgMFDisplayWikibaseDescriptions":{"search":true,"watchlist":true,"tagline":false,"nearby":true},"wgEditSubmitButtonLabelPublish":true,"wgULSPosition":"personal","wgULSisCompactLinksEnabled":true,"wgVector2022LanguageInHeader":false,"wgULSisLanguageSelectorEmpty":false,"wgCheckUserClientHintsHeadersJsApi":["brands","architecture","bitness","fullVersionList","mobile","model","platform","platformVersion"]};RLSTATE={"site.styles":"ready","user.styles":"ready","user":"ready","user.options":"loading","ext.pygments":"ready", "skins.vector.styles.legacy":"ready","ext.visualEditor.desktopArticleTarget.noscript":"ready","codex-search-styles":"ready","ext.uls.pt":"ready"};RLPAGEMODULES=["ext.pygments.view","site","mediawiki.page.ready","mediawiki.toc","skins.vector.legacy.js","ext.fundraiserLandingPage.LogPageview","ext.urlShortener.toolbar","ext.visualEditor.desktopArticleTarget.init","ext.visualEditor.targetLoader","ext.eventLogging","ext.uls.compactlinks","ext.uls.interface","ext.checkUser.clientHints"];</script> <script>(RLQ=window.RLQ||[]).push(function(){mw.loader.impl(function(){return["user.options@12s5i",function($,jQuery,require,module){mw.user.tokens.set({"patrolToken":"+\\","watchToken":"+\\","csrfToken":"+\\"}); }];});});</script> <link rel="stylesheet" href="/w/load.php?lang=en&modules=codex-search-styles%7Cext.pygments%7Cext.uls.pt%7Cext.visualEditor.desktopArticleTarget.noscript%7Cskins.vector.styles.legacy&only=styles&skin=vector"> <script async="" src="/w/load.php?lang=en&modules=startup&only=scripts&raw=1&skin=vector"></script> <meta name="ResourceLoaderDynamicStyles" content=""> <link rel="stylesheet" href="/w/load.php?lang=en&modules=site.styles&only=styles&skin=vector"> <meta name="generator" content="MediaWiki 1.44.0-wmf.4"> <meta name="referrer" content="origin"> <meta name="referrer" content="origin-when-cross-origin"> <meta name="robots" content="max-image-preview:standard"> <meta name="format-detection" content="telephone=no"> <meta name="viewport" content="width=1120"> <meta property="og:title" content="Module:Main - Wikimedia Foundation"> <meta property="og:type" content="website"> <link rel="alternate" media="only screen and (max-width: 640px)" href="//donate.m.wikimedia.org/wiki/Module:Main"> <link rel="icon" href="/static/favicon/wmf.ico"> <link rel="search" type="application/opensearchdescription+xml" href="/w/rest.php/v1/search" title="Donate (en)"> <link rel="EditURI" type="application/rsd+xml" href="//donate.wikimedia.org/w/api.php?action=rsd"> <link rel="canonical" href="https://donate.wikimedia.org/wiki/Module:Main"> <link rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/"> <link rel="alternate" type="application/atom+xml" title="Donate Atom feed" href="/w/index.php?title=Special:RecentChanges&feed=atom"> </head> <body class="skin-vector-legacy mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-828 ns-subject page-Module_Main rootpage-Module_Main skin-vector action-view"><div id="mw-page-base" class="noprint"></div> <div id="mw-head-base" class="noprint"></div> <div id="content" class="mw-body" role="main"> <a id="top"></a> <div id="siteNotice"></div> <div class="mw-indicators"> </div> <h1 id="firstHeading" class="firstHeading mw-first-heading"><span class="mw-page-title-namespace">Module</span><span class="mw-page-title-separator">:</span><span class="mw-page-title-main">Main</span></h1> <div id="bodyContent" class="vector-body"> <div id="siteSub" class="noprint">From Donate</div> <div id="contentSub"><div id="mw-content-subtitle"></div></div> <div id="contentSub2"></div> <div id="jump-to-nav"></div> <a class="mw-jump-link" href="#mw-head">Jump to navigation</a> <a class="mw-jump-link" href="#searchInput">Jump to search</a> <div id="mw-content-text" class="mw-body-content"><div class="mw-content-ltr mw-parser-output" lang="en" dir="ltr"><div id="toc" class="toc" role="navigation" aria-labelledby="mw-toc-heading"><input type="checkbox" role="button" id="toctogglecheckbox" class="toctogglecheckbox" style="display:none" /><div class="toctitle" lang="en" dir="ltr"><h2 id="mw-toc-heading">Contents</h2><span class="toctogglespan"><label class="toctogglelabel" for="toctogglecheckbox"></label></span></div> <ul> <li class="toclevel-1"><a href="#Documentation"><span class="tocnumber">1</span> <span class="toctext">Documentation</span></a> <ul> <li class="toclevel-2"><a href="#get_appeal"><span class="tocnumber">1.1</span> <span class="toctext">get_appeal</span></a></li> <li class="toclevel-2"><a href="#get_infobox"><span class="tocnumber">1.2</span> <span class="toctext">get_infobox</span></a></li> <li class="toclevel-2"><a href="#get_tax_message"><span class="tocnumber">1.3</span> <span class="toctext">get_tax_message</span></a></li> <li class="toclevel-2"><a href="#page_language"><span class="tocnumber">1.4</span> <span class="toctext">page_language</span></a></li> </ul> </li> </ul> </div> <div class="mw-heading mw-heading2"><h2 id="Documentation">Documentation</h2></div> <div class="mw-heading mw-heading3"><h3 id="get_appeal">get_appeal</h3></div> <p>Includes the best localised appeal subpage of <a href="/wiki/Template:Appeal" title="Template:Appeal">Template:Appeal</a>, based on appeal name, language, and country given. Also passes the parameters to the selected appeal template for their use (e.g. in localising amounts with {{<a href="/wiki/Template:AppealAmountSwitch" title="Template:AppealAmountSwitch">AppealAmountSwitch</a>}}) </p><p><b>Parameters:</b> </p> <ul><li><code>appeal</code> - initial "Appeal-" (which was required for older links) is stripped off if present</li> <li><code>language</code></li> <li><code>country</code></li> <li>Any other parameters to pass through to the appeal template (e.g. <code>sitename</code>)</li></ul> <p><b>Example:</b> </p><p><code>{{#invoke:Main|get_appeal|appeal=Alan|country=CA|language=fr}}</code> </p> <ul><li>Display <a href="/w/index.php?title=Template:Appeal/Alan/fr/CA&action=edit&redlink=1" class="new" title="Template:Appeal/Alan/fr/CA (page does not exist)">Template:Appeal/Alan/fr/CA</a> if it exists, else</li> <li>display <a href="/wiki/Template:Appeal/Alan/fr" title="Template:Appeal/Alan/fr">Template:Appeal/Alan/fr</a> if it exists, else</li> <li>display <a href="/wiki/Template:Appeal/Alan/en" title="Template:Appeal/Alan/en">Template:Appeal/Alan/en</a> if it exists, else</li> <li>display <a href="/wiki/Template:Appeal/default/fr" title="Template:Appeal/default/fr">Template:Appeal/default/fr</a> if it exists, else</li> <li>display <a href="/wiki/Template:Appeal/default/en" title="Template:Appeal/default/en">Template:Appeal/default/en</a></li></ul> <p>Replaces {{<a href="/wiki/Template:2012FR/Switch/Appeal" title="Template:2012FR/Switch/Appeal">2012FR/Switch/Appeal</a>}} </p> <div class="mw-heading mw-heading3"><h3 id="get_infobox">get_infobox</h3></div> <p>Does basically the same thing for subpages of <a href="/wiki/Template:Infobox" title="Template:Infobox">Template:Infobox</a> </p><p>Replaces {{<a href="/wiki/Template:2012FR/Switch/Infobox" title="Template:2012FR/Switch/Infobox">2012FR/Switch/Infobox</a>}} </p> <div class="mw-heading mw-heading3"><h3 id="get_tax_message">get_tax_message</h3></div> <p>Code should be fairly self explanatory. Allows overriding the default message for certain countries. </p> <div class="mw-heading mw-heading3"><h3 id="page_language">page_language</h3></div> <p>Return the language code of the current subpage. If it isn't a subpage, or isn't a valid language code, return 'en'. </p> <hr /><div class="mw-highlight mw-highlight-lang-lua mw-content-ltr mw-highlight-lines" dir="ltr"><pre><span></span><span id="L-1"><a href="#L-1"><span class="linenos" data-line="1"></span></a><span class="c1">-- Single utility module. Break this into separate modules if it gets too large.</span> </span><span id="L-2"><a href="#L-2"><span class="linenos" data-line="2"></span></a> </span><span id="L-3"><a href="#L-3"><span class="linenos" data-line="3"></span></a><span class="kd">local</span> <span class="n">p</span> <span class="o">=</span> <span class="p">{}</span> <span class="c1">-- p stands for package</span> </span><span id="L-4"><a href="#L-4"><span class="linenos" data-line="4"></span></a> </span><span id="L-5"><a href="#L-5"><span class="linenos" data-line="5"></span></a><span class="c1">-- Given an array of titles as strings, check them in order and return the first page which exists</span> </span><span id="L-6"><a href="#L-6"><span class="linenos" data-line="6"></span></a><span class="kr">function</span> <span class="nc">p</span><span class="p">.</span><span class="nf">fallback_pages</span><span class="p">(</span> <span class="n">list</span> <span class="p">)</span> </span><span id="L-7"><a href="#L-7"><span class="linenos" data-line="7"></span></a> <span class="kr">for</span> <span class="n">key</span><span class="p">,</span> <span class="n">value</span> <span class="kr">in</span> <span class="nb">ipairs</span><span class="p">(</span> <span class="n">list</span> <span class="p">)</span> <span class="kr">do</span> </span><span id="L-8"><a href="#L-8"><span class="linenos" data-line="8"></span></a> <span class="kd">local</span> <span class="n">p</span> <span class="o">=</span> <span class="n">mw</span><span class="p">.</span><span class="n">title</span><span class="p">.</span><span class="n">new</span><span class="p">(</span> <span class="n">value</span> <span class="p">)</span> </span><span id="L-9"><a href="#L-9"><span class="linenos" data-line="9"></span></a> <span class="kr">if</span> <span class="n">p</span><span class="p">.</span><span class="n">exists</span> <span class="kr">then</span> </span><span id="L-10"><a href="#L-10"><span class="linenos" data-line="10"></span></a> <span class="kr">return</span> <span class="n">p</span> </span><span id="L-11"><a href="#L-11"><span class="linenos" data-line="11"></span></a> <span class="kr">end</span> </span><span id="L-12"><a href="#L-12"><span class="linenos" data-line="12"></span></a> <span class="kr">end</span> </span><span id="L-13"><a href="#L-13"><span class="linenos" data-line="13"></span></a><span class="kr">end</span> </span><span id="L-14"><a href="#L-14"><span class="linenos" data-line="14"></span></a> </span><span id="L-15"><a href="#L-15"><span class="linenos" data-line="15"></span></a><span class="kr">function</span> <span class="nc">p</span><span class="p">.</span><span class="nf">get_appeal</span><span class="p">(</span> <span class="n">frame</span> <span class="p">)</span> </span><span id="L-16"><a href="#L-16"><span class="linenos" data-line="16"></span></a> </span><span id="L-17"><a href="#L-17"><span class="linenos" data-line="17"></span></a> <span class="kd">local</span> <span class="n">appeal_name</span> <span class="o">=</span> <span class="nb">string.gsub</span><span class="p">(</span> <span class="n">frame</span><span class="p">.</span><span class="n">args</span><span class="p">.</span><span class="n">appeal</span> <span class="p">,</span> <span class="s1">'Appeal%-'</span><span class="p">,</span> <span class="s1">''</span> <span class="p">)</span> </span><span id="L-18"><a href="#L-18"><span class="linenos" data-line="18"></span></a> <span class="kd">local</span> <span class="n">language</span> <span class="o">=</span> <span class="n">frame</span><span class="p">.</span><span class="n">args</span><span class="p">.</span><span class="n">language</span> </span><span id="L-19"><a href="#L-19"><span class="linenos" data-line="19"></span></a> <span class="kd">local</span> <span class="n">country</span> <span class="o">=</span> <span class="n">frame</span><span class="p">.</span><span class="n">args</span><span class="p">.</span><span class="n">country</span> </span><span id="L-20"><a href="#L-20"><span class="linenos" data-line="20"></span></a> </span><span id="L-21"><a href="#L-21"><span class="linenos" data-line="21"></span></a> <span class="kd">local</span> <span class="n">page</span> <span class="o">=</span> <span class="n">p</span><span class="p">.</span><span class="n">fallback_pages</span><span class="p">({</span> </span><span id="L-22"><a href="#L-22"><span class="linenos" data-line="22"></span></a> <span class="s1">'Template:Appeal/'</span> <span class="o">..</span> <span class="n">appeal_name</span> <span class="o">..</span> <span class="s1">'/'</span> <span class="o">..</span> <span class="n">language</span> <span class="o">..</span> <span class="s1">'/'</span> <span class="o">..</span> <span class="n">country</span><span class="p">,</span> </span><span id="L-23"><a href="#L-23"><span class="linenos" data-line="23"></span></a> <span class="s1">'Template:Appeal/'</span> <span class="o">..</span> <span class="n">appeal_name</span> <span class="o">..</span> <span class="s1">'/'</span> <span class="o">..</span> <span class="n">language</span><span class="p">,</span> </span><span id="L-24"><a href="#L-24"><span class="linenos" data-line="24"></span></a> <span class="s1">'Template:Appeal/'</span> <span class="o">..</span> <span class="n">appeal_name</span> <span class="o">..</span> <span class="s1">'/en'</span><span class="p">,</span> </span><span id="L-25"><a href="#L-25"><span class="linenos" data-line="25"></span></a> <span class="s1">'Template:Appeal/default/'</span> <span class="o">..</span> <span class="n">language</span><span class="p">,</span> </span><span id="L-26"><a href="#L-26"><span class="linenos" data-line="26"></span></a> <span class="s1">'Template:Appeal/default/en'</span> </span><span id="L-27"><a href="#L-27"><span class="linenos" data-line="27"></span></a> <span class="p">})</span> </span><span id="L-28"><a href="#L-28"><span class="linenos" data-line="28"></span></a> </span><span id="L-29"><a href="#L-29"><span class="linenos" data-line="29"></span></a> <span class="kd">local</span> <span class="n">expanded</span> <span class="o">=</span> <span class="n">frame</span><span class="p">:</span><span class="n">expandTemplate</span><span class="p">{</span> <span class="n">title</span> <span class="o">=</span> <span class="n">page</span><span class="p">,</span> <span class="n">args</span> <span class="o">=</span> <span class="n">frame</span><span class="p">.</span><span class="n">args</span> <span class="p">}</span> </span><span id="L-30"><a href="#L-30"><span class="linenos" data-line="30"></span></a> <span class="kr">return</span> <span class="n">expanded</span> </span><span id="L-31"><a href="#L-31"><span class="linenos" data-line="31"></span></a> </span><span id="L-32"><a href="#L-32"><span class="linenos" data-line="32"></span></a><span class="kr">end</span> </span><span id="L-33"><a href="#L-33"><span class="linenos" data-line="33"></span></a> </span><span id="L-34"><a href="#L-34"><span class="linenos" data-line="34"></span></a><span class="kr">function</span> <span class="nc">p</span><span class="p">.</span><span class="nf">get_infobox</span><span class="p">(</span> <span class="n">frame</span> <span class="p">)</span> </span><span id="L-35"><a href="#L-35"><span class="linenos" data-line="35"></span></a> </span><span id="L-36"><a href="#L-36"><span class="linenos" data-line="36"></span></a> <span class="kd">local</span> <span class="n">infobox_name</span> <span class="o">=</span> <span class="n">frame</span><span class="p">.</span><span class="n">args</span><span class="p">.</span><span class="n">infobox</span> </span><span id="L-37"><a href="#L-37"><span class="linenos" data-line="37"></span></a> <span class="kd">local</span> <span class="n">language</span> <span class="o">=</span> <span class="n">frame</span><span class="p">.</span><span class="n">args</span><span class="p">.</span><span class="n">language</span> </span><span id="L-38"><a href="#L-38"><span class="linenos" data-line="38"></span></a> <span class="kd">local</span> <span class="n">country</span> <span class="o">=</span> <span class="n">frame</span><span class="p">.</span><span class="n">args</span><span class="p">.</span><span class="n">country</span> </span><span id="L-39"><a href="#L-39"><span class="linenos" data-line="39"></span></a> </span><span id="L-40"><a href="#L-40"><span class="linenos" data-line="40"></span></a> <span class="kd">local</span> <span class="n">page</span> <span class="o">=</span> <span class="n">p</span><span class="p">.</span><span class="n">fallback_pages</span><span class="p">({</span> </span><span id="L-41"><a href="#L-41"><span class="linenos" data-line="41"></span></a> <span class="s1">'Template:Infobox/'</span> <span class="o">..</span> <span class="n">infobox_name</span> <span class="o">..</span> <span class="s1">'/'</span> <span class="o">..</span> <span class="n">language</span> <span class="o">..</span> <span class="s1">'/'</span> <span class="o">..</span> <span class="n">country</span><span class="p">,</span> </span><span id="L-42"><a href="#L-42"><span class="linenos" data-line="42"></span></a> <span class="s1">'Template:Infobox/'</span> <span class="o">..</span> <span class="n">infobox_name</span> <span class="o">..</span> <span class="s1">'/'</span> <span class="o">..</span> <span class="n">language</span><span class="p">,</span> </span><span id="L-43"><a href="#L-43"><span class="linenos" data-line="43"></span></a> <span class="s1">'Template:Infobox/'</span> <span class="o">..</span> <span class="n">infobox_name</span> <span class="o">..</span> <span class="s1">'/en'</span><span class="p">,</span> </span><span id="L-44"><a href="#L-44"><span class="linenos" data-line="44"></span></a> <span class="s1">'Template:Infobox/Default/'</span> <span class="o">..</span> <span class="n">language</span><span class="p">,</span> </span><span id="L-45"><a href="#L-45"><span class="linenos" data-line="45"></span></a> <span class="s1">'Template:Infobox/Default/en'</span> </span><span id="L-46"><a href="#L-46"><span class="linenos" data-line="46"></span></a> <span class="p">})</span> </span><span id="L-47"><a href="#L-47"><span class="linenos" data-line="47"></span></a> </span><span id="L-48"><a href="#L-48"><span class="linenos" data-line="48"></span></a> <span class="kd">local</span> <span class="n">expanded</span> <span class="o">=</span> <span class="n">frame</span><span class="p">:</span><span class="n">expandTemplate</span><span class="p">{</span> <span class="n">title</span> <span class="o">=</span> <span class="n">page</span><span class="p">,</span> <span class="n">args</span> <span class="o">=</span> <span class="n">frame</span><span class="p">.</span><span class="n">args</span> <span class="p">}</span> </span><span id="L-49"><a href="#L-49"><span class="linenos" data-line="49"></span></a> <span class="kr">return</span> <span class="n">expanded</span> </span><span id="L-50"><a href="#L-50"><span class="linenos" data-line="50"></span></a> </span><span id="L-51"><a href="#L-51"><span class="linenos" data-line="51"></span></a><span class="kr">end</span> </span><span id="L-52"><a href="#L-52"><span class="linenos" data-line="52"></span></a> </span><span id="L-53"><a href="#L-53"><span class="linenos" data-line="53"></span></a><span class="kr">function</span> <span class="nc">p</span><span class="p">.</span><span class="nf">get_tax_message</span><span class="p">(</span> <span class="n">frame</span> <span class="p">)</span> </span><span id="L-54"><a href="#L-54"><span class="linenos" data-line="54"></span></a> </span><span id="L-55"><a href="#L-55"><span class="linenos" data-line="55"></span></a> <span class="kd">local</span> <span class="n">tax_message</span> <span class="o">=</span> <span class="n">frame</span><span class="p">.</span><span class="n">args</span><span class="p">.</span><span class="n">tax_message</span> </span><span id="L-56"><a href="#L-56"><span class="linenos" data-line="56"></span></a> <span class="kd">local</span> <span class="n">language</span> <span class="o">=</span> <span class="n">frame</span><span class="p">.</span><span class="n">args</span><span class="p">.</span><span class="n">language</span> </span><span id="L-57"><a href="#L-57"><span class="linenos" data-line="57"></span></a> <span class="kd">local</span> <span class="n">country</span> <span class="o">=</span> <span class="n">frame</span><span class="p">.</span><span class="n">args</span><span class="p">.</span><span class="n">country</span> </span><span id="L-58"><a href="#L-58"><span class="linenos" data-line="58"></span></a> <span class="kd">local</span> <span class="n">page</span> </span><span id="L-59"><a href="#L-59"><span class="linenos" data-line="59"></span></a> </span><span id="L-60"><a href="#L-60"><span class="linenos" data-line="60"></span></a> <span class="kr">if</span> <span class="p">(</span> <span class="n">country</span> <span class="o">==</span> <span class="s1">'US'</span> <span class="p">)</span> <span class="kr">then</span> </span><span id="L-61"><a href="#L-61"><span class="linenos" data-line="61"></span></a> <span class="n">page</span> <span class="o">=</span> <span class="n">mw</span><span class="p">.</span><span class="n">title</span><span class="p">.</span><span class="n">new</span><span class="p">(</span> <span class="s1">'Template:Tax/LinkOnly'</span> <span class="p">)</span> </span><span id="L-62"><a href="#L-62"><span class="linenos" data-line="62"></span></a> <span class="kr">else</span> </span><span id="L-63"><a href="#L-63"><span class="linenos" data-line="63"></span></a> <span class="n">page</span> <span class="o">=</span> <span class="n">p</span><span class="p">.</span><span class="n">fallback_pages</span><span class="p">({</span> </span><span id="L-64"><a href="#L-64"><span class="linenos" data-line="64"></span></a> <span class="s1">'Template:Tax/'</span> <span class="o">..</span> <span class="n">tax_message</span> <span class="o">..</span> <span class="s1">'/'</span> <span class="o">..</span> <span class="n">language</span><span class="p">,</span> <span class="c1">-- custom message</span> </span><span id="L-65"><a href="#L-65"><span class="linenos" data-line="65"></span></a> <span class="s1">'Template:Tax/'</span> <span class="o">..</span> <span class="n">country</span> <span class="o">..</span> <span class="s1">'/'</span> <span class="o">..</span> <span class="n">language</span><span class="p">,</span> <span class="c1">-- special countries e.g. FR/NL</span> </span><span id="L-66"><a href="#L-66"><span class="linenos" data-line="66"></span></a> <span class="s1">'Template:Tax/Default/'</span> <span class="o">..</span> <span class="n">language</span><span class="p">,</span> </span><span id="L-67"><a href="#L-67"><span class="linenos" data-line="67"></span></a> <span class="s1">'Template:Tax/LinkOnly'</span> </span><span id="L-68"><a href="#L-68"><span class="linenos" data-line="68"></span></a> <span class="p">})</span> </span><span id="L-69"><a href="#L-69"><span class="linenos" data-line="69"></span></a> <span class="kr">end</span> </span><span id="L-70"><a href="#L-70"><span class="linenos" data-line="70"></span></a> </span><span id="L-71"><a href="#L-71"><span class="linenos" data-line="71"></span></a> <span class="kd">local</span> <span class="n">expanded</span> <span class="o">=</span> <span class="n">frame</span><span class="p">:</span><span class="n">expandTemplate</span><span class="p">{</span> <span class="n">title</span> <span class="o">=</span> <span class="n">page</span><span class="p">,</span> <span class="n">args</span> <span class="o">=</span> <span class="n">frame</span><span class="p">.</span><span class="n">args</span> <span class="p">}</span> </span><span id="L-72"><a href="#L-72"><span class="linenos" data-line="72"></span></a> <span class="kr">return</span> <span class="n">expanded</span> </span><span id="L-73"><a href="#L-73"><span class="linenos" data-line="73"></span></a> </span><span id="L-74"><a href="#L-74"><span class="linenos" data-line="74"></span></a><span class="kr">end</span> </span><span id="L-75"><a href="#L-75"><span class="linenos" data-line="75"></span></a> </span><span id="L-76"><a href="#L-76"><span class="linenos" data-line="76"></span></a><span class="kr">function</span> <span class="nc">p</span><span class="p">.</span><span class="nf">page_language</span><span class="p">(</span> <span class="n">frame</span> <span class="p">)</span> </span><span id="L-77"><a href="#L-77"><span class="linenos" data-line="77"></span></a> </span><span id="L-78"><a href="#L-78"><span class="linenos" data-line="78"></span></a> <span class="kd">local</span> <span class="n">full_title</span> <span class="o">=</span> <span class="n">mw</span><span class="p">.</span><span class="n">title</span><span class="p">.</span><span class="n">getCurrentTitle</span><span class="p">().</span><span class="n">prefixedText</span> </span><span id="L-79"><a href="#L-79"><span class="linenos" data-line="79"></span></a> <span class="kd">local</span> <span class="n">t</span> <span class="o">=</span> <span class="n">mw</span><span class="p">.</span><span class="n">text</span><span class="p">.</span><span class="n">split</span><span class="p">(</span> <span class="n">full_title</span><span class="p">,</span> <span class="s1">'/'</span> <span class="p">)</span> </span><span id="L-80"><a href="#L-80"><span class="linenos" data-line="80"></span></a> <span class="kd">local</span> <span class="n">lang</span> <span class="o">=</span> <span class="n">t</span><span class="p">[</span><span class="o">#</span><span class="n">t</span><span class="p">]</span> </span><span id="L-81"><a href="#L-81"><span class="linenos" data-line="81"></span></a> </span><span id="L-82"><a href="#L-82"><span class="linenos" data-line="82"></span></a> <span class="kr">if</span> <span class="n">mw</span><span class="p">.</span><span class="n">language</span><span class="p">.</span><span class="n">isKnownLanguageTag</span><span class="p">(</span> <span class="n">lang</span> <span class="p">)</span> <span class="kr">then</span> </span><span id="L-83"><a href="#L-83"><span class="linenos" data-line="83"></span></a> <span class="kr">return</span> <span class="n">lang</span> </span><span id="L-84"><a href="#L-84"><span class="linenos" data-line="84"></span></a> <span class="kr">else</span> </span><span id="L-85"><a href="#L-85"><span class="linenos" data-line="85"></span></a> <span class="kr">return</span> <span class="s1">'en'</span> </span><span id="L-86"><a href="#L-86"><span class="linenos" data-line="86"></span></a> <span class="kr">end</span> </span><span id="L-87"><a href="#L-87"><span class="linenos" data-line="87"></span></a> </span><span id="L-88"><a href="#L-88"><span class="linenos" data-line="88"></span></a><span class="kr">end</span> </span><span id="L-89"><a href="#L-89"><span class="linenos" data-line="89"></span></a> </span><span id="L-90"><a href="#L-90"><span class="linenos" data-line="90"></span></a><span class="kr">return</span> <span class="n">p</span> </span></pre></div> <!-- NewPP limit report Parsed by mw‐web.codfw.main‐5c9b544f44‐jvvr5 Cached time: 20241127090556 Cache expiry: 2592000 Reduced expiry: false Complications: [show‐toc] CPU time usage: 0.008 seconds Real time usage: 0.013 seconds Preprocessor visited node count: 30/1000000 Post‐expand include size: 1707/2097152 bytes Template argument size: 118/2097152 bytes Highest expansion depth: 5/100 Expensive parser function count: 0/500 Unstrip recursion depth: 0/20 Unstrip post‐expand size: 62/5000000 bytes --> <!-- Transclusion expansion time report (%,ms,calls,template) 100.00% 4.945 1 -total 100.00% 4.945 1 Module:Main/doc 52.40% 2.591 3 Template:Tl --> </div> <div class="printfooter" data-nosnippet="">Retrieved from "<a dir="ltr" href="https://donate.wikimedia.org/w/index.php?title=Module:Main&oldid=40487">https://donate.wikimedia.org/w/index.php?title=Module:Main&oldid=40487</a>"</div></div> <div id="catlinks" class="catlinks catlinks-allhidden" data-mw="interface"></div> </div> </div> <div id="mw-navigation"> <h2>Navigation menu</h2> <div id="mw-head"> <nav id="p-personal" class="mw-portlet mw-portlet-personal vector-user-menu-legacy vector-menu" aria-labelledby="p-personal-label" > <h3 id="p-personal-label" class="vector-menu-heading " > <span class="vector-menu-heading-label">Personal tools</span> </h3> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="pt-uls" class="mw-list-item active"><a class="uls-trigger" href="#"><span>English</span></a></li><li id="pt-login" class="mw-list-item"><a href="/w/index.php?title=Special:UserLogin&returnto=Module%3AMain" title="You are encouraged to log in; however, it is not mandatory [o]" accesskey="o"><span>Log in</span></a></li> </ul> </div> </nav> <div id="left-navigation"> <nav id="p-namespaces" class="mw-portlet mw-portlet-namespaces vector-menu-tabs vector-menu-tabs-legacy vector-menu" aria-labelledby="p-namespaces-label" > <h3 id="p-namespaces-label" class="vector-menu-heading " > <span class="vector-menu-heading-label">Namespaces</span> </h3> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-nstab-module" class="selected mw-list-item"><a href="/wiki/Module:Main" title="View the module page [c]" accesskey="c"><span>Module</span></a></li><li id="ca-talk" class="new mw-list-item"><a href="/w/index.php?title=Module_talk:Main&action=edit&redlink=1" rel="discussion" class="new" title="Discussion about the content page (page does not exist) [t]" accesskey="t"><span>Discussion</span></a></li> </ul> </div> </nav> <nav id="p-variants" class="mw-portlet mw-portlet-variants emptyPortlet vector-menu-dropdown vector-menu" aria-labelledby="p-variants-label" > <input type="checkbox" id="p-variants-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-p-variants" class="vector-menu-checkbox" aria-labelledby="p-variants-label" > <label id="p-variants-label" class="vector-menu-heading " > <span class="vector-menu-heading-label">English</span> </label> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </nav> </div> <div id="right-navigation"> <nav id="p-views" class="mw-portlet mw-portlet-views vector-menu-tabs vector-menu-tabs-legacy vector-menu" aria-labelledby="p-views-label" > <h3 id="p-views-label" class="vector-menu-heading " > <span class="vector-menu-heading-label">Views</span> </h3> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-view" class="selected mw-list-item"><a href="/wiki/Module:Main"><span>Read</span></a></li><li id="ca-viewsource" class="mw-list-item"><a href="/w/index.php?title=Module:Main&action=edit" title="This page is protected. You can view its source [e]" accesskey="e"><span>View source</span></a></li><li id="ca-history" class="mw-list-item"><a href="/w/index.php?title=Module:Main&action=history" title="Past revisions of this page [h]" accesskey="h"><span>View history</span></a></li> </ul> </div> </nav> <nav id="p-cactions" class="mw-portlet mw-portlet-cactions emptyPortlet vector-menu-dropdown vector-menu" aria-labelledby="p-cactions-label" title="More options" > <input type="checkbox" id="p-cactions-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-p-cactions" class="vector-menu-checkbox" aria-labelledby="p-cactions-label" > <label id="p-cactions-label" class="vector-menu-heading " > <span class="vector-menu-heading-label">More</span> </label> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </nav> <div id="p-search" role="search" class="vector-search-box-vue vector-search-box-show-thumbnail vector-search-box-auto-expand-width vector-search-box"> <h3 >Search</h3> <form action="/w/index.php" id="searchform" class="vector-search-box-form"> <div id="simpleSearch" class="vector-search-box-inner" data-search-loc="header-navigation"> <input class="vector-search-box-input" type="search" name="search" placeholder="Search Donate" aria-label="Search Donate" autocapitalize="sentences" title="Search Donate [f]" accesskey="f" id="searchInput" > <input type="hidden" name="title" value="Special:Search"> <input id="mw-searchButton" class="searchButton mw-fallbackSearchButton" type="submit" name="fulltext" title="Search the pages for this text" value="Search"> <input id="searchButton" class="searchButton" type="submit" name="go" title="Go to a page with this exact name if it exists" value="Go"> </div> </form> </div> </div> </div> <div id="mw-panel" class="vector-legacy-sidebar"> <div id="p-logo" role="banner"> <a class="mw-wiki-logo" href="https://foundation.wikimedia.org/wiki/Home" title="Visit the main page"></a> </div> <nav id="p-navigation" class="mw-portlet mw-portlet-navigation vector-menu-portal portal vector-menu" aria-labelledby="p-navigation-label" > <h3 id="p-navigation-label" class="vector-menu-heading " > <span class="vector-menu-heading-label">Navigation</span> </h3> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-Support-pages-index" class="mw-list-item"><a href="/wiki/Support_pages_index"><span>Support pages index</span></a></li><li id="n-Other-ways-to-give" class="mw-list-item"><a href="/wiki/Other_ways_to_give"><span>Other ways to give</span></a></li><li id="n-Problems-donating" class="mw-list-item"><a href="/wiki/Problems_donating"><span>Problems donating</span></a></li><li id="n-Cancel-or-change-recurring-giving" class="mw-list-item"><a href="/wiki/Cancel_or_change_recurring_giving"><span>Cancel or change recurring giving</span></a></li><li id="n-Matching-Gifts" class="mw-list-item"><a href="/wiki/Matching_Gifts"><span>Matching Gifts</span></a></li> </ul> </div> </nav> <nav id="p-Wiki" class="mw-portlet mw-portlet-Wiki vector-menu-portal portal vector-menu" aria-labelledby="p-Wiki-label" > <h3 id="p-Wiki-label" class="vector-menu-heading " > <span class="vector-menu-heading-label">Wiki</span> </h3> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-Recent-changes" class="mw-list-item"><a href="/wiki/Special:RecentChanges"><span>Recent changes</span></a></li><li id="n-Documentation-(collab)" class="mw-list-item"><a href="https://collab.wikimedia.org/wiki/Fundraising/Donatewiki_documentation"><span>Documentation (collab)</span></a></li> </ul> </div> </nav> <nav id="p-tb" class="mw-portlet mw-portlet-tb vector-menu-portal portal vector-menu" aria-labelledby="p-tb-label" > <h3 id="p-tb-label" class="vector-menu-heading " > <span class="vector-menu-heading-label">Tools</span> </h3> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="t-whatlinkshere" class="mw-list-item"><a href="/wiki/Special:WhatLinksHere/Module:Main" title="A list of all wiki pages that link here [j]" accesskey="j"><span>What links here</span></a></li><li id="t-recentchangeslinked" class="mw-list-item"><a href="/wiki/Special:RecentChangesLinked/Module:Main" rel="nofollow" title="Recent changes in pages linked from this page [k]" accesskey="k"><span>Related changes</span></a></li><li id="t-specialpages" class="mw-list-item"><a href="/wiki/Special:SpecialPages" title="A list of all special pages [q]" accesskey="q"><span>Special pages</span></a></li><li id="t-permalink" class="mw-list-item"><a href="/w/index.php?title=Module:Main&oldid=40487" title="Permanent link to this revision of this page"><span>Permanent link</span></a></li><li id="t-info" class="mw-list-item"><a href="/w/index.php?title=Module:Main&action=info" title="More information about this page"><span>Page information</span></a></li><li id="t-urlshortener" class="mw-list-item"><a href="/w/index.php?title=Special:UrlShortener&url=https%3A%2F%2Fdonate.wikimedia.org%2Fwiki%2FModule%3AMain"><span>Get shortened URL</span></a></li><li id="t-urlshortener-qrcode" class="mw-list-item"><a href="/w/index.php?title=Special:QrCode&url=https%3A%2F%2Fdonate.wikimedia.org%2Fwiki%2FModule%3AMain"><span>Download QR code</span></a></li> </ul> </div> </nav> <nav id="p-electronpdfservice-sidebar-portlet-heading" class="mw-portlet mw-portlet-electronpdfservice-sidebar-portlet-heading vector-menu-portal portal vector-menu" aria-labelledby="p-electronpdfservice-sidebar-portlet-heading-label" > <h3 id="p-electronpdfservice-sidebar-portlet-heading-label" class="vector-menu-heading " > <span class="vector-menu-heading-label">Print/export</span> </h3> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="electron-print_pdf" class="mw-list-item"><a href="/w/index.php?title=Special:DownloadAsPdf&page=Module%3AMain&action=show-download-screen"><span>Download as PDF</span></a></li><li id="t-print" class="mw-list-item"><a href="javascript:print();" rel="alternate" title="Printable version of this page [p]" accesskey="p"><span>Printable version</span></a></li> </ul> </div> </nav> </div> </div> <footer id="footer" class="mw-footer" > <ul id="footer-info"> <li id="footer-info-lastmod"> This page was last edited on 1 October 2024, at 17:55.</li> <li id="footer-info-copyright">Text is available under the <a rel="nofollow" class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.en">Creative Commons Attribution-ShareAlike License</a>; additional terms may apply. See <a class="external text" href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Terms_of_Use">Terms of Use</a> for details.</li> </ul> <ul id="footer-places"> <li id="footer-places-privacy"><a href="https://foundation.wikimedia.org/wiki/Project:Privacy_policy">Privacy policy</a></li> <li id="footer-places-about"><a href="https://foundation.wikimedia.org/wiki/Project:About">About Donate</a></li> <li id="footer-places-disclaimers"><a href="https://foundation.wikimedia.org/wiki/Project:General_disclaimer">Disclaimers</a></li> <li id="footer-places-wm-codeofconduct"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Universal_Code_of_Conduct">Code of Conduct</a></li> <li id="footer-places-developers"><a href="https://developer.wikimedia.org">Developers</a></li> <li id="footer-places-statslink"><a href="https://stats.wikimedia.org/#/donate.wikimedia.org">Statistics</a></li> <li id="footer-places-cookiestatement"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Cookie_statement">Cookie statement</a></li> <li id="footer-places-mobileview"><a href="//donate.m.wikimedia.org/w/index.php?title=Module:Main&mobileaction=toggle_view_mobile" class="noprint stopMobileRedirectToggle">Mobile view</a></li> </ul> <ul id="footer-icons" class="noprint"> <li id="footer-copyrightico"><a href="https://wikimediafoundation.org/" class="cdx-button cdx-button--fake-button cdx-button--size-large cdx-button--fake-button--enabled"><img src="/static/images/footer/wikimedia-button.svg" width="84" height="29" alt="Wikimedia Foundation" loading="lazy"></a></li> <li id="footer-poweredbyico"><a href="https://www.mediawiki.org/" class="cdx-button cdx-button--fake-button cdx-button--size-large cdx-button--fake-button--enabled"><img src="/w/resources/assets/poweredby_mediawiki.svg" alt="Powered by MediaWiki" width="88" height="31" loading="lazy"></a></li> </ul> </footer> <script>(RLQ=window.RLQ||[]).push(function(){mw.log.warn("This page is using the deprecated ResourceLoader module \"codex-search-styles\".\n[1.43] Use a CodexModule with codexComponents to set your specific components used: https://www.mediawiki.org/wiki/Codex#Using_a_limited_subset_of_components");mw.config.set({"wgHostname":"mw-web.codfw.main-5c9b544f44-jvvr5","wgBackendResponseTime":88,"wgPageParseReport":{"limitreport":{"cputime":"0.008","walltime":"0.013","ppvisitednodes":{"value":30,"limit":1000000},"postexpandincludesize":{"value":1707,"limit":2097152},"templateargumentsize":{"value":118,"limit":2097152},"expansiondepth":{"value":5,"limit":100},"expensivefunctioncount":{"value":0,"limit":500},"unstrip-depth":{"value":0,"limit":20},"unstrip-size":{"value":62,"limit":5000000},"timingprofile":["100.00% 4.945 1 -total","100.00% 4.945 1 Module:Main/doc"," 52.40% 2.591 3 Template:Tl"]},"cachereport":{"origin":"mw-web.codfw.main-5c9b544f44-jvvr5","timestamp":"20241127090556","ttl":2592000,"transientcontent":false}}});});</script> </body> </html>