CINXE.COM
View source for Module:Lang - Wikipedia
<!DOCTYPE html> <html class="client-nojs skin-theme-clientpref-day mf-expand-sections-clientpref-0 mf-font-size-clientpref-small mw-mf-amc-clientpref-0" lang="en" dir="ltr"> <head> <meta charset="UTF-8"> <title>View source for Module:Lang - Wikipedia</title> <script>(function(){var className="client-js skin-theme-clientpref-day mf-expand-sections-clientpref-0 mf-font-size-clientpref-small mw-mf-amc-clientpref-0";var cookie=document.cookie.match(/(?:^|; )enwikimwclientpreferences=([^;]+)/);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":true,"wgSeparatorTransformTable":["",""],"wgDigitTransformTable":["",""],"wgDefaultDateFormat":"dmy","wgMonthNames":["","January","February","March","April","May","June","July","August","September","October","November","December"],"wgRequestId":"f7589ec7-84dd-40bf-895f-b981a5d36169","wgCanonicalNamespace":"Module","wgCanonicalSpecialPageName":false,"wgNamespaceNumber":828,"wgPageName":"Module:Lang","wgTitle":"Lang","wgCurRevisionId":1258592030,"wgRevisionId":0,"wgArticleId":55674518,"wgIsArticle": false,"wgIsRedirect":false,"wgAction":"edit","wgUserName":null,"wgUserGroups":["*"],"wgPageViewLanguage":"en","wgPageContentLanguage":"en","wgPageContentModel":"Scribunto","wgRelevantPageName":"Module:Lang","wgRelevantArticleId":55674518,"wgIsProbablyEditable":false,"wgRelevantPageIsProbablyEditable":false,"wgRestrictionEdit":["templateeditor"],"wgRestrictionMove":["templateeditor"],"wgNoticeProject":"wikipedia","wgCiteReferencePreviewsActive":false,"wgFlaggedRevsParams":{"tags":{"status":{"levels":1}}},"wgMediaViewerOnClick":true,"wgMediaViewerEnabledByDefault":true,"wgPopupsFlags":0,"wgVisualEditor":{"pageLanguageCode":"en","pageLanguageDir":"ltr","pageVariantFallbacks":"en"},"wgMFMode":"stable","wgMFAmc":false,"wgMFAmcOutreachActive":false,"wgMFAmcOutreachUserEligible":false,"wgMFLazyLoadImages":true,"wgMFEditNoticesFeatureConflict":false,"wgMFDisplayWikibaseDescriptions":{"search":true,"watchlist":true,"tagline":false,"nearby":true},"wgMFIsSupportedEditRequest":false, "wgMFScriptPath":"","wgWMESchemaEditAttemptStepOversample":false,"wgWMEPageLength":90000,"wgCodeEditorCurrentLanguage":"lua","wgRelatedArticlesCompat":[],"wgCentralAuthMobileDomain":true,"wgEditSubmitButtonLabelPublish":true,"wgSectionTranslationTargetLanguages":["ace","ady","alt","am","ami","an","ang","ann","anp","ar","ary","arz","as","ast","av","avk","awa","ay","az","azb","ba","ban","bar","bbc","bcl","bdr","be","bew","bg","bho","bi","bjn","blk","bm","bn","bo","bpy","br","bs","btm","bug","ca","cdo","ce","ceb","ch","chr","ckb","co","cr","crh","cs","cu","cy","da","dag","de","dga","din","diq","dsb","dtp","dv","dz","ee","el","eml","eo","es","et","eu","fa","fat","ff","fi","fj","fo","fon","fr","frp","frr","fur","fy","gag","gan","gcr","gl","glk","gn","gom","gor","gpe","gu","guc","gur","guw","gv","ha","hak","haw","he","hi","hif","hr","hsb","ht","hu","hy","hyw","ia","iba","ie","ig","igl","ilo","io","is","it","iu","ja","jam","jv","ka","kaa","kab","kbd","kbp","kcg","kg","kge","ki","kk","kl","km" ,"kn","ko","koi","krc","ks","ku","kus","kv","kw","ky","lad","lb","lez","lg","li","lij","lld","lmo","ln","lo","lt","ltg","lv","mad","mai","map-bms","mdf","mg","mhr","mi","min","mk","ml","mn","mni","mnw","mos","mr","mrj","ms","mt","mwl","my","myv","mzn","nah","nan","nap","nb","nds","nds-nl","ne","new","nia","nl","nn","nqo","nr","nso","ny","oc","om","or","os","pa","pag","pam","pap","pcd","pcm","pdc","pl","pms","pnb","ps","pt","pwn","qu","rm","rn","ro","rsk","rue","rup","rw","sa","sah","sat","sc","scn","sco","sd","se","sg","sgs","sh","shi","shn","si","sk","skr","sl","sm","smn","sn","so","sq","sr","srn","ss","st","stq","su","sv","sw","szl","ta","tay","tcy","tdd","te","tet","tg","th","ti","tk","tl","tly","tn","to","tpi","tr","trv","ts","tt","tum","tw","ty","tyv","udm","ur","uz","ve","vec","vep","vi","vls","vo","vro","wa","war","wo","wuu","xal","xh","xmf","yi","yo","yue","za","zgh","zh","zu"],"isLanguageSearcherCXEntrypointEnabled":false,"mintEntrypointLanguages":["ace","ast","azb","bcl", "bjn","bh","crh","ff","fon","ig","is","ki","ks","lmo","min","sat","ss","tn","vec"],"wgCheckUserClientHintsHeadersJsApi":["brands","architecture","bitness","fullVersionList","mobile","model","platform","platformVersion"],"GEHomepageSuggestedEditsEnableTopics":true,"wgGETopicsMatchModeEnabled":false,"wgGEStructuredTaskRejectionReasonTextInputEnabled":false,"wgGELevelingUpEnabledForUser":false,"wgMinervaPermissions":{"watchable":true,"watch":false},"wgMinervaFeatures":{"beta":false,"donate":true,"mobileOptionsLink":true,"categories":false,"pageIssues":true,"talkAtTop":true,"historyInPageActions":false,"overflowSubmenu":false,"tabsOnSpecials":true,"personalMenu":false,"mainMenuExpanded":false,"echo":true,"nightMode":true},"wgMinervaDownloadNamespaces":[0]};RLSTATE={"ext.globalCssJs.user.styles":"ready","site.styles":"ready","user.styles":"ready","ext.globalCssJs.user":"ready","user":"ready","user.options":"loading","ext.codeEditor.styles":"ready","skins.minerva.styles":"ready", "skins.minerva.content.styles.images":"ready","mediawiki.hlist":"ready","skins.minerva.codex.styles":"ready","skins.minerva.icons":"ready","mediawiki.ui.button":"ready","skins.minerva.amc.styles":"ready","ext.charinsert.styles":"ready","ext.wikimediamessages.styles":"ready","mobile.init.styles":"ready","ext.wikimediaBadges":"ready"};RLPAGEMODULES=["ext.codeEditor","ext.scribunto.edit","mediawiki.action.edit.collapsibleFooter","site","mediawiki.page.ready","skins.minerva.scripts","ext.centralNotice.geoIP","ext.charinsert","ext.gadget.charinsert","ext.gadget.extra-toolbar-buttons","ext.gadget.refToolbar","ext.gadget.switcher","ext.urlShortener.toolbar","ext.centralauth.centralautologin","ext.popups","mobile.init","ext.echo.centralauth","ext.eventLogging","ext.wikimediaEvents","ext.navigationTiming","ext.cx.eventlogging.campaigns","ext.cx.entrypoints.languagesearcher.init","mw.externalguidance.init","ext.checkUser.clientHints","wikibase.sidebar.tracking"];</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=ext.charinsert.styles%7Cext.codeEditor.styles%7Cext.wikimediaBadges%7Cext.wikimediamessages.styles%7Cmediawiki.hlist%7Cmediawiki.ui.button%7Cmobile.init.styles%7Cskins.minerva.amc.styles%7Cskins.minerva.codex.styles%7Cskins.minerva.content.styles.images%7Cskins.minerva.icons%2Cstyles&only=styles&skin=minerva"> <script async="" src="/w/load.php?lang=en&modules=startup&only=scripts&raw=1&skin=minerva"></script> <meta name="ResourceLoaderDynamicStyles" content=""> <link rel="stylesheet" href="/w/load.php?lang=en&modules=site.styles&only=styles&skin=minerva"> <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="noindex,nofollow,max-image-preview:standard"> <meta name="format-detection" content="telephone=no"> <meta name="theme-color" content="#eaecf0"> <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes, minimum-scale=0.25, maximum-scale=5.0"> <meta property="og:title" content="View source for Module:Lang - Wikipedia"> <meta property="og:type" content="website"> <link rel="preconnect" href="//upload.wikimedia.org"> <link rel="manifest" href="/w/api.php?action=webapp-manifest"> <link rel="apple-touch-icon" href="/static/apple-touch/wikipedia.png"> <link rel="icon" href="/static/favicon/wikipedia.ico"> <link rel="search" type="application/opensearchdescription+xml" href="/w/rest.php/v1/search" title="Wikipedia (en)"> <link rel="EditURI" type="application/rsd+xml" href="//en.wikipedia.org/w/api.php?action=rsd"> <link rel="canonical" href="https://en.wikipedia.org/wiki/Module:Lang"> <link rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/deed.en"> <link rel="dns-prefetch" href="//login.wikimedia.org"> </head> <body class="codeeditor-loading mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-828 ns-subject page-Module_Lang rootpage-Module_Lang stable skin-minerva action-edit skin--responsive mw-mf-amc-disabled mw-mf"><div id="mw-mf-viewport"> <div id="mw-mf-page-center"> <a class="mw-mf-page-center__mask" href="#"></a> <header class="header-container header-chrome"> <div class="minerva-header"> <nav class="navigation-drawer toggle-list view-border-box"> <input type="checkbox" id="main-menu-input" class="toggle-list__checkbox" role="button" aria-haspopup="true" aria-expanded="false" aria-labelledby="mw-mf-main-menu-button"> <label role="button" for="main-menu-input" id="mw-mf-main-menu-button" aria-hidden="true" data-event-name="ui.mainmenu" class="cdx-button cdx-button--size-large cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--icon-only cdx-button--weight-quiet toggle-list__toggle"> <span class="minerva-icon minerva-icon--menu"></span> <span></span> </label> <div id="mw-mf-page-left" class="menu view-border-box"> <ul id="p-navigation" class="toggle-list__list"> <li class="toggle-list-item "> <a class="toggle-list-item__anchor menu__item--home" href="/wiki/Main_Page" data-mw="interface"> <span class="minerva-icon minerva-icon--home"></span> <span class="toggle-list-item__label">Home</span> </a> </li> <li class="toggle-list-item "> <a class="toggle-list-item__anchor menu__item--random" href="/wiki/Special:Random" data-mw="interface"> <span class="minerva-icon minerva-icon--die"></span> <span class="toggle-list-item__label">Random</span> </a> </li> <li class="toggle-list-item skin-minerva-list-item-jsonly"> <a class="toggle-list-item__anchor menu__item--nearby" href="/wiki/Special:Nearby" data-event-name="menu.nearby" data-mw="interface"> <span class="minerva-icon minerva-icon--mapPin"></span> <span class="toggle-list-item__label">Nearby</span> </a> </li> </ul> <ul id="p-personal" class="toggle-list__list"> <li class="toggle-list-item "> <a class="toggle-list-item__anchor menu__item--login" href="/w/index.php?title=Special:UserLogin&returnto=Module%3ALang&returntoquery=action%3Dedit" data-event-name="menu.login" data-mw="interface"> <span class="minerva-icon minerva-icon--logIn"></span> <span class="toggle-list-item__label">Log in</span> </a> </li> </ul> <ul id="pt-preferences" class="toggle-list__list"> <li class="toggle-list-item skin-minerva-list-item-jsonly"> <a class="toggle-list-item__anchor menu__item--settings" href="/w/index.php?title=Special:MobileOptions&returnto=Module%3ALang" data-event-name="menu.settings" data-mw="interface"> <span class="minerva-icon minerva-icon--settings"></span> <span class="toggle-list-item__label">Settings</span> </a> </li> </ul> <ul id="p-donation" class="toggle-list__list"> <li class="toggle-list-item "> <a class="toggle-list-item__anchor menu__item--donate" href="https://donate.wikimedia.org/wiki/Special:FundraiserRedirector?utm_source=donate&utm_medium=sidebar&utm_campaign=C13_en.wikipedia.org&uselang=en&utm_key=minerva" data-event-name="menu.donate" data-mw="interface"> <span class="minerva-icon minerva-icon--heart"></span> <span class="toggle-list-item__label">Donate</span> </a> </li> </ul> <ul class="hlist"> <li class="toggle-list-item "> <a class="toggle-list-item__anchor menu__item--about" href="/wiki/Wikipedia:About" data-mw="interface"> <span class="toggle-list-item__label">About Wikipedia</span> </a> </li> <li class="toggle-list-item "> <a class="toggle-list-item__anchor menu__item--disclaimers" href="/wiki/Wikipedia:General_disclaimer" data-mw="interface"> <span class="toggle-list-item__label">Disclaimers</span> </a> </li> </ul> </div> <label class="main-menu-mask" for="main-menu-input"></label> </nav> <div class="branding-box"> <a href="/wiki/Main_Page"> <span><img src="/static/images/mobile/copyright/wikipedia-wordmark-en.svg" alt="Wikipedia" width="120" height="18" style="width: 7.5em; height: 1.125em;"/> </span> </a> </div> <form action="/w/index.php" method="get" class="minerva-search-form"> <div class="search-box"> <input type="hidden" name="title" value="Special:Search"/> <input class="search skin-minerva-search-trigger" id="searchInput" type="search" name="search" placeholder="Search Wikipedia" aria-label="Search Wikipedia" autocapitalize="sentences" title="Search Wikipedia [f]" accesskey="f"> <span class="search-box-icon-overlay"><span class="minerva-icon minerva-icon--search"></span> </span> </div> <button id="searchIcon" class="cdx-button cdx-button--size-large cdx-button--icon-only cdx-button--weight-quiet skin-minerva-search-trigger"> <span class="minerva-icon minerva-icon--search"></span> <span>Search</span> </button> </form> <nav class="minerva-user-navigation" aria-label="User navigation"> </nav> </div> </header> <main id="content" class="mw-body"> <div class="banner-container"> <div id="siteNotice"></div> </div> <div class="pre-content heading-holder"> <div class="page-heading"> <h1 id="firstHeading" class="firstHeading mw-first-heading">View source for Module:Lang</h1> <div class="tagline"></div> </div> <div id="mw-content-subtitle">← <a href="/wiki/Module:Lang" title="Module:Lang">Module:Lang</a></div> </div> <div id="bodyContent" class="content"> <div id="mw-content-text" class="mw-body-content"><script>function mfTempOpenSection(id){var block=document.getElementById("mf-section-"+id);block.className+=" open-block";block.previousSibling.className+=" open-block";}</script><p>You do not have permission to edit this page, for the following reasons: </p> <ul class="permissions-errors"><li class="mw-permissionerror-protectedpagetext"><div class="mw-parser-output"> </div></li><li class="mw-permissionerror-cascadeprotected"><div class="mw-parser-output"> <div class="mw-parser-output"><style data-mw-deduplicate="TemplateStyles:r1099782930">.mw-parser-output .pptext-whywhat h2{margin-top:1em;border-bottom:0;font-size:130%;font-weight:bold;padding:0.15em}.mw-parser-output .pptext-submit{list-style:none;display:inline;text-align:center}.mw-parser-output .pptext-whywhat{display:flex;flex-wrap:wrap;column-gap:2em}.mw-parser-output .pptext-whywhat>div{flex:1 1 400px}</style><style data-mw-deduplicate="TemplateStyles:r1238441935">.mw-parser-output .fmbox{clear:both;margin:0.2em 0;width:100%;border:1px solid #a2a9b1;background-color:var(--background-color-interactive-subtle,#f8f9fa);box-sizing:border-box;color:var(--color-base,#202122)}.mw-parser-output .fmbox-warning{border:1px solid #bb7070;background-color:#ffdbdb}.mw-parser-output .fmbox-editnotice{background-color:transparent}.mw-parser-output .fmbox .mbox-text{border:none;padding:0.25em 0.9em;width:100%}.mw-parser-output .fmbox .mbox-image{border:none;padding:2px 0 2px 0.9em;text-align:center}.mw-parser-output .fmbox .mbox-imageright{border:none;padding:2px 0.9em 2px 0;text-align:center}.mw-parser-output .fmbox .mbox-invalid-type{text-align:center}@media screen{html.skin-theme-clientpref-night .mw-parser-output .fmbox-warning{background-color:#300}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .fmbox-warning{background-color:#300}}</style><table id="mw-protectedpagetext" class="plainlinks fmbox fmbox-system" role="presentation" style="border-style:none;"><tbody><tr><td class="mbox-text"><style data-mw-deduplicate="TemplateStyles:r1238436933">.mw-parser-output .ombox{margin:4px 0;border-collapse:collapse;border:1px solid #a2a9b1;background-color:var(--background-color-neutral-subtle,#f8f9fa);box-sizing:border-box;color:var(--color-base,#202122)}.mw-parser-output .ombox.mbox-small{font-size:88%;line-height:1.25em}.mw-parser-output .ombox-speedy{border:2px solid #b32424;background-color:#fee7e6}.mw-parser-output .ombox-delete{border:2px solid #b32424}.mw-parser-output .ombox-content{border:1px solid #f28500}.mw-parser-output .ombox-style{border:1px solid #fc3}.mw-parser-output .ombox-move{border:1px solid #9932cc}.mw-parser-output .ombox-protection{border:2px solid #a2a9b1}.mw-parser-output .ombox .mbox-text{border:none;padding:0.25em 0.9em;width:100%}.mw-parser-output .ombox .mbox-image{border:none;padding:2px 0 2px 0.9em;text-align:center}.mw-parser-output .ombox .mbox-imageright{border:none;padding:2px 0.9em 2px 0;text-align:center}.mw-parser-output .ombox .mbox-empty-cell{border:none;padding:0;width:1px}.mw-parser-output .ombox .mbox-invalid-type{text-align:center}@media(min-width:720px){.mw-parser-output .ombox{margin:4px 10%}.mw-parser-output .ombox.mbox-small{clear:right;float:right;margin:4px 0 4px 1em;width:238px}}body.skin--responsive .mw-parser-output table.ombox img{max-width:none!important}@media screen{html.skin-theme-clientpref-night .mw-parser-output .ombox-speedy{background-color:#310402}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .ombox-speedy{background-color:#310402}}</style><table class="plainlinks ombox ombox-protection" role="presentation"><tbody><tr><td class="mbox-image"><span typeof="mw:File"><span><img alt="" src="//upload.wikimedia.org/wikipedia/en/thumb/0/0f/Cascade-protection-shackle.svg/40px-Cascade-protection-shackle.svg.png" decoding="async" width="40" height="40" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/en/thumb/0/0f/Cascade-protection-shackle.svg/60px-Cascade-protection-shackle.svg.png 1.5x, //upload.wikimedia.org/wikipedia/en/thumb/0/0f/Cascade-protection-shackle.svg/80px-Cascade-protection-shackle.svg.png 2x" data-file-width="512" data-file-height="512"></span></span></td><td class="mbox-text" style="font-weight:bold; font-size:130%;"><div style="text-align: center;">This page is <a href="/wiki/Wikipedia:Transclusion" class="mw-redirect" title="Wikipedia:Transclusion">transcluded</a> in multiple <a href="/wiki/Wikipedia:Protection_policy#Cascading_protection" title="Wikipedia:Protection policy">cascade-protected</a> pages, so only <a href="/wiki/Wikipedia:Administrators" title="Wikipedia:Administrators">administrators</a> can edit it.</div></td></tr></tbody></table> <div class="pptext-whywhat"> <div class="pptext-why"> <div class="mw-heading mw-heading2"><h2 id="Why_is_the_page_protected?"><span id="Why_is_the_page_protected.3F"></span>Why is the page protected?</h2></div> <ul> <li>Cascading protection is used to prevent vandalism to particularly visible pages, such as the <a href="/wiki/Main_Page" title="Main Page">Main Page</a> and a few <a href="/wiki/Wikipedia:High-risk_templates" title="Wikipedia:High-risk templates">very highly used templates</a>.</li> <li>This page is <a href="/wiki/Wikipedia:Transclusion" class="mw-redirect" title="Wikipedia:Transclusion">transcluded</a> in the following pages, which are protected with the "<a href="/wiki/Wikipedia:Protection_policy#Cascading_protection" title="Wikipedia:Protection policy">cascading</a>" option: <ul><li><a href="/wiki/Wikipedia:Main_Page/1" title="Wikipedia:Main Page/1">Wikipedia:Main Page/1</a></li> <li><a href="/wiki/Wikipedia:Main_Page/2" title="Wikipedia:Main Page/2">Wikipedia:Main Page/2</a></li> <li><a href="/wiki/Wikipedia:Main_Page/3" title="Wikipedia:Main Page/3">Wikipedia:Main Page/3</a></li> <li><a href="/wiki/Wikipedia:Main_Page/4" title="Wikipedia:Main Page/4">Wikipedia:Main Page/4</a></li> <li><a href="/wiki/Wikipedia:Main_Page/5" title="Wikipedia:Main Page/5">Wikipedia:Main Page/5</a></li> <li><a href="/wiki/Main_Page" title="Main Page">Main Page</a></li> <li><a href="/wiki/Wikipedia:Cascade-protected_items/Main_Page" title="Wikipedia:Cascade-protected items/Main Page">Wikipedia:Cascade-protected items/Main Page</a></li> <li><a href="/wiki/Wikipedia:Cascade-protected_items/Main_Page/2" title="Wikipedia:Cascade-protected items/Main Page/2">Wikipedia:Cascade-protected items/Main Page/2</a></li> <li><a href="/wiki/Wikipedia:Cascade-protected_items/Main_Page/3" title="Wikipedia:Cascade-protected items/Main Page/3">Wikipedia:Cascade-protected items/Main Page/3</a></li> <li><a href="/wiki/Wikipedia:Cascade-protected_items/Main_Page/4" title="Wikipedia:Cascade-protected items/Main Page/4">Wikipedia:Cascade-protected items/Main Page/4</a></li> <li><a href="/wiki/Wikipedia:Cascade-protected_items/Main_Page/5" title="Wikipedia:Cascade-protected items/Main Page/5">Wikipedia:Cascade-protected items/Main Page/5</a></li></ul> </li> </ul> </div> <div class="pptext-what"> <div class="mw-heading mw-heading2"><h2 id="What_can_I_do?"><span id="What_can_I_do.3F"></span>What can I do?</h2></div> <ul> <li><a href="/wiki/Module_talk:Lang" class="mw-redirect" title="Module talk:Lang">Discuss this page</a> with others.</li> <li>For move-protected pages, see <a href="/wiki/Wikipedia:Requested_moves" title="Wikipedia:Requested moves">requested moves</a>.</li> <li><a href="/wiki/Wikipedia:Requests_for_page_protection#Current_requests_for_reduction_in_protection_level" title="Wikipedia:Requests for page protection">Request that the page's protection level be reduced</a>.</li> <li><a href="/wiki/Help:Introduction" title="Help:Introduction">Find out more about how to get started editing Wikipedia</a>.</li> <li>If you have noticed an error or have a suggestion for a <b>simple, non-controversial change</b>, you can submit an edit request by clicking the button below and following the instructions. An <a href="/wiki/Wikipedia:Administrators" title="Wikipedia:Administrators">administrator</a> may then make the change on your behalf. Please check <a href="/wiki/Module_talk:Lang" class="mw-redirect" title="Module talk:Lang">the talk page</a> first in case the issue is already being discussed.</li> <li class="pptext-submit"><div> <p><span class="plainlinks clickbutton"><a class="external text" href="https://en.wikipedia.org/w/index.php?title=Template_talk%3ALang&preload=Template%3ASubmit+an+edit+request%2Fpreload&action=edit&section=new&editintro=Template%3AEdit+protected%2Feditintro&preloadtitle=Protected+edit+request+on+24+November+2024&preloadparams%5B%5D=edit+fully-protected&preloadparams%5B%5D=Module%3ALang"><span class="mw-ui-button mw-ui-progressive">Submit an edit request</span></a></span> </p> </div></li> <li>If you wrote any text, please save it temporarily to your device until you can edit this page.</li> </ul> </div> </div></td></tr></tbody></table></div> </div></li><li class="mw-permissionerror-blockedtext"> <div id="mw-blocked-text" style="border: 1px solid #AAA; background-color: var(--background-color-warning-subtle, ivory); color: inherit; padding: 1.5em; width: 100%; box-sizing: border-box;"> <div style="text-align: center;"><span style="font-size: 26px;"><span typeof="mw:File"><a href="/wiki/File:Stop_hand_nuvola.svg" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/en/thumb/f/f1/Stop_hand_nuvola.svg/50px-Stop_hand_nuvola.svg.png" decoding="async" width="50" height="50" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/en/thumb/f/f1/Stop_hand_nuvola.svg/75px-Stop_hand_nuvola.svg.png 1.5x, //upload.wikimedia.org/wikipedia/en/thumb/f/f1/Stop_hand_nuvola.svg/100px-Stop_hand_nuvola.svg.png 2x" data-file-width="240" data-file-height="240"></a></span><b> This IP address has been <a href="/wiki/Wikipedia:Blocking_policy" title="Wikipedia:Blocking policy">blocked</a> from <i>editing</i> Wikipedia.</b></span><br><span style="font-size: 18px;">This does not affect your ability to <i>read</i> Wikipedia pages.</span></div><div class="paragraphbreak" style="margin-top:0.5em"></div><b>Most people who see this message have done nothing wrong.</b> Some kinds of blocks restrict editing from specific service providers or telecom companies in response to recent abuse or vandalism, and can sometimes affect other users who are unrelated to that abuse. Review the information below for assistance if you do not believe that you have done anything wrong.<div class="paragraphbreak" style="margin-top:0.5em"></div> <p>The IP address or range 8.222.128.0/17 has been <a href="/wiki/Wikipedia:Blocking_policy" title="Wikipedia:Blocking policy">blocked</a> by <a href="/wiki/User:L235" title="User:L235">L235</a> for the following reason(s): </p> <div style="padding:10px; background:var(--background-color-base, white); color:inherit; border:1px #666 solid;"> <div class="user-block colocation-webhost" style="margin-bottom: 0.5em; background-color: #ffefd5; border: 1px solid #AAA; padding: 0.7em;"> <figure class="mw-halign-left" typeof="mw:File"><span><img src="//upload.wikimedia.org/wikipedia/commons/thumb/5/53/Server-multiple.svg/40px-Server-multiple.svg.png" decoding="async" width="40" height="57" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/5/53/Server-multiple.svg/60px-Server-multiple.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/5/53/Server-multiple.svg/80px-Server-multiple.svg.png 2x" data-file-width="744" data-file-height="1052"></span><figcaption></figcaption></figure><b>The <a href="/wiki/IP_address" title="IP address">IP address</a> that you are currently using has been blocked because it is believed to be a <a href="/wiki/Web_hosting_service" title="Web hosting service">web host provider</a> or <a href="/wiki/Colocation_centre" title="Colocation centre">colocation provider</a>.</b> To prevent abuse, <a href="/wiki/Wikipedia:Open_proxies" title="Wikipedia:Open proxies">web hosts and colocation providers may be blocked</a> from editing Wikipedia. <div style="border-top: 1px solid #AAA; clear: both">You will not be able to edit Wikipedia using a web host or colocation provider because it hides your IP address, much like a <a href="/wiki/Wikipedia:Open_proxies" title="Wikipedia:Open proxies">proxy</a> or <a href="/wiki/Virtual_private_network" title="Virtual private network">VPN</a>. <p><b>We recommend that you attempt to use another connection to edit.</b> For example, if you use a proxy or VPN to connect to the internet, turn it off when editing Wikipedia. If you edit using a mobile connection, try using a Wi-Fi connection, and vice versa. If you are using a corporate internet connection, switch to a different Wi-Fi network. If you have a Wikipedia account, please log in. </p><p>If you do not have any other way to edit Wikipedia, you will need to <a href="/wiki/Wikipedia:IP_block_exemption#Requesting_and_granting_exemption" title="Wikipedia:IP block exemption">request an IP block exemption</a>. </p> <style data-mw-deduplicate="TemplateStyles:r1214851843">.mw-parser-output .hidden-begin{box-sizing:border-box;width:100%;padding:5px;border:none;font-size:95%}.mw-parser-output .hidden-title{font-weight:bold;line-height:1.6;text-align:left}.mw-parser-output .hidden-content{text-align:left}@media all and (max-width:500px){.mw-parser-output .hidden-begin{width:auto!important;clear:none!important;float:none!important}}</style><div class="hidden-begin mw-collapsible mw-collapsed" style=""><div class="hidden-title skin-nightmode-reset-color" style="text-align:center;">How to appeal if you are confident that your connection does not use a colocation provider's IP address:</div><div class="hidden-content mw-collapsible-content" style=""> If you are confident that you are not using a web host, you may <a href="/wiki/Wikipedia:Appealing_a_block" title="Wikipedia:Appealing a block">appeal this block</a> by adding the following text on your <a href="/wiki/Help:Talk_pages" title="Help:Talk pages">talk page</a>: <code>{{<a href="/wiki/Template:Unblock" title="Template:Unblock">unblock</a>|reason=Caught by a colocation web host block but this host or IP is not a web host. My IP address is _______. <i>Place any further information here.</i> ~~~~}}</code>. <b>You must fill in the blank with your IP address for this block to be investigated.</b> Your IP address can be determined <span class="plainlinks"><b><a class="external text" href="https://en.wikipedia.org/wiki/Wikipedia:Get_my_IP_address?withJS=MediaWiki:Get-my-ip.js">here</a></b></span>. Alternatively, if you wish to keep your IP address private you can use the <a href="/wiki/Wikipedia:Unblock_Ticket_Request_System" title="Wikipedia:Unblock Ticket Request System">unblock ticket request system</a>. There are several reasons you might be editing using the IP address of a web host or colocation provider (such as if you are using VPN software or a business network); please use this method of appeal only if you think your IP address is in fact not a web host or colocation provider.</div></div> <p><span class="sysop-show" style="font-size: 85%;"><span style="border:#707070 solid 1px;background-color:#ffe0e0;padding:2px"><b>Administrators:</b></span> The <a href="/wiki/Wikipedia:IP_block_exemption" title="Wikipedia:IP block exemption">IP block exemption</a> user right should only be applied to allow users to edit using web host in exceptional circumstances, and requests should usually be directed to the functionaries team via email. If you intend to give the IPBE user right, a <a href="/wiki/Wikipedia:CheckUser" title="Wikipedia:CheckUser">CheckUser</a> needs to take a look at the account. This can be requested most easily at <a href="/wiki/Wikipedia:SPI#Quick_CheckUser_requests" class="mw-redirect" title="Wikipedia:SPI">SPI Quick Checkuser Requests</a>. <b>Unblocking</b> an IP or IP range with this template <b>is highly discouraged</b> without at least contacting the blocking administrator.</span> </p> </div></div> </div> <p>This block will expire on 18:23, 24 August 2026. Your current IP address is 8.222.208.146. </p> <div class="paragraphbreak" style="margin-top:0.5em"></div><div style="font-size: 16px;"> <p>Even when blocked, you will <i>usually</i> still be able to edit your <a href="/wiki/Special:MyTalk" title="Special:MyTalk">user talk page</a>, as well as <a href="/wiki/Wikipedia:Emailing_users" title="Wikipedia:Emailing users">email</a> administrators and other editors. </p> </div> <div class="paragraphbreak" style="margin-top:0.5em"></div><div style="font-size: 16px;"> <p>For information on how to proceed, please read the <b><a href="/wiki/Wikipedia:Appealing_a_block#Common_questions" title="Wikipedia:Appealing a block">FAQ for blocked users</a></b> and the <a href="/wiki/Wikipedia:Appealing_a_block" title="Wikipedia:Appealing a block">guideline on block appeals</a>. The <a href="/wiki/Wikipedia:Guide_to_appealing_blocks" title="Wikipedia:Guide to appealing blocks">guide to appealing blocks</a> may also be helpful. </p> </div> <p>Other useful links: <a href="/wiki/Wikipedia:Blocking_policy" title="Wikipedia:Blocking policy">Blocking policy</a> · <a href="/wiki/Help:I_have_been_blocked" title="Help:I have been blocked">Help:I have been blocked</a> </p> </div></li><li class="mw-permissionerror-globalblocking-blockedtext-range"> <div id="mw-blocked-text" style="border: 1px solid #AAA; background-color: var(--background-color-warning-subtle, ivory); color: inherit; padding: 1.5em; width: 100%; box-sizing: border-box;"> <div style="text-align: center;"><span style="font-size: 26px;"><span typeof="mw:File"><a href="/wiki/File:Stop_hand_nuvola.svg" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/en/thumb/f/f1/Stop_hand_nuvola.svg/50px-Stop_hand_nuvola.svg.png" decoding="async" width="50" height="50" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/en/thumb/f/f1/Stop_hand_nuvola.svg/75px-Stop_hand_nuvola.svg.png 1.5x, //upload.wikimedia.org/wikipedia/en/thumb/f/f1/Stop_hand_nuvola.svg/100px-Stop_hand_nuvola.svg.png 2x" data-file-width="240" data-file-height="240"></a></span><b> This IP address range has been <a href="https://meta.wikimedia.org/wiki/Global_blocks" class="extiw" title="m:Global blocks">globally blocked</a>.</b></span><br><span style="font-size: 18px;">This does not affect your ability to <i>read</i> Wikipedia pages.</span></div><div class="paragraphbreak" style="margin-top:0.5em"></div><b>Most people who see this message have done nothing wrong.</b> Some kinds of blocks restrict editing from specific service providers or telecom companies in response to recent abuse or vandalism, and can sometimes affect other users who are unrelated to that abuse. Review the information below for assistance if you do not believe that you have done anything wrong.<div class="paragraphbreak" style="margin-top:0.5em"></div><div class="paragraphbreak" style="margin-top:0.5em"></div> <p>This block affects editing on all Wikimedia wikis. </p><p>The IP address or range 8.222.128.0/17 has been globally <a href="/wiki/Wikipedia:Blocking_policy" title="Wikipedia:Blocking policy">blocked</a> by <a href="/wiki/User:Jon_Kolbert" title="User:Jon Kolbert">Jon Kolbert</a> for the following reason(s): </p> <div style="padding:10px; background:var(--background-color-base, white); color:inherit; border:1px #666 solid;"> <p><a href="https://meta.wikimedia.org/wiki/Special:MyLanguage/NOP" class="extiw" title="m:Special:MyLanguage/NOP">Open proxy/Webhost</a>: See the <a href="https://meta.wikimedia.org/wiki/WM:OP/H" class="extiw" title="m:WM:OP/H">help page</a> if you are affected </p> </div> <p>This block will expire on 15:12, 27 August 2028. Your current IP address is 8.222.208.146. </p> <div class="paragraphbreak" style="margin-top:0.5em"></div><div style="font-size: 16px;"> <p>Even while globally blocked, you will <i>usually</i> still be able to edit pages on <a href="https://meta.wikimedia.org/wiki/" class="extiw" title="m:">Meta-Wiki</a>. </p> </div> <div class="paragraphbreak" style="margin-top:0.5em"></div><div style="font-size: 16px;"> <p>If you believe you were blocked by mistake, you can find additional information and instructions in the <a href="https://meta.wikimedia.org/wiki/Special:MyLanguage/No_open_proxies" class="extiw" title="m:Special:MyLanguage/No open proxies">No open proxies</a> global policy. Otherwise, to discuss the block please <a href="https://meta.wikimedia.org/wiki/Steward_requests/Global" class="extiw" title="m:Steward requests/Global">post a request for review on Meta-Wiki</a>. You could also send an email to the <a href="https://meta.wikimedia.org/wiki/Special:MyLanguage/Stewards" class="extiw" title="m:Special:MyLanguage/Stewards">stewards</a> <a href="https://meta.wikimedia.org/wiki/Special:MyLanguage/VRT" class="extiw" title="m:Special:MyLanguage/VRT">VRT</a> queue at <kbd>stewards@wikimedia.org</kbd> including all above details. </p> </div> <p>Other useful links: <a href="https://meta.wikimedia.org/wiki/Global_blocks" class="extiw" title="m:Global blocks">Global blocks</a> · <a href="/wiki/Help:I_have_been_blocked" title="Help:I have been blocked">Help:I have been blocked</a> </p> </div></li></ul> <!-- MobileFormatter took 0.002 seconds --><hr /> <div id="viewsourcetext">You can view and copy the source of this page:</div><textarea readonly="" accesskey="," id="wpTextbox1" cols="80" rows="25" style="" class="mw-editfont-monospace" lang="en" dir="ltr" name="wpTextbox1">--[=[ Lua support for the {{lang}}, {{langx}}, {{lang-??}}, and {{transliteration}} templates and replacement of various supporting templates. ]=] require('strict'); local getArgs = require ('Module:Arguments').getArgs; local unicode = require ("Module:Unicode data"); -- for is_latin() and is_rtl() local yesno = require ('Module:Yesno'); local lang_data = mw.loadData ('Module:Lang/data'); -- language name override and transliteration tool-tip tables local lang_name_table = lang_data.lang_name_table; -- language codes, names, regions, scripts, suppressed scripts local lang_table = lang_data.lang_name_table.lang; local lang_dep_table = lang_data.lang_name_table.lang_dep; local script_table = lang_data.lang_name_table.script; local region_table = lang_data.lang_name_table.region; local variant_table = lang_data.lang_name_table.variant; local suppressed_table = lang_data.lang_name_table.suppressed; local override_table = lang_data.override; local synonym_table = mw.loadData ('Module:Lang/ISO 639 synonyms'); -- ISO 639-2/639-2T code translation to 639-1 code local namespace = mw.title.getCurrentTitle().namespace; -- used for categorization local content_lang = mw.language.getContentLanguage(); local this_wiki_lang_tag = content_lang.code; -- get this wiki's language tag local this_wiki_lang_dir = content_lang:getDir(); -- get this wiki's language direction local initial_style_state; -- set by lang_xx_normal() and lang_xx_italic() local maint_cats = {}; -- maintenance categories go here local maint_msgs = {}; -- and their messages go here local templates = { lang = 'Lang', langx = 'Langx', langxx = 'Lang-xx', } --[[--------------------------< C O M M O N _ P A R A M S >---------------------------------------------------- ]] local known_params_t = { ['common_params_all_t'] = { -- these parameters common to {{lang}}, {{langx}}, and {{lang-xx}} ['code'] = true, ['text'] = true, ['rtl'] = true, ['italic'] = true, ['italics'] = true, ['i'] = true, ['size'] = true, ['proto'] = true, ['nocat'] = true, ['cat'] = true, ['template'] = true, -- supplied by external templates to provide template name for error messaging ({{nihongo}}, etc) }, ['params_lang_t'] = { -- unique to {{lang}} [1] = true, -- alias of |code= [2] = true, -- alias of |text= }, ['params_x_t'] = { -- common to {{langx}} and {{lang-xx}} ['translit'] = true, ['translit-std'] = true, ['translit-script'] = true, ['translation'] = true, ['lit='] = true, ['label'] = true, ['link'] = true, ['links'] = true, ['lit'] = true, ['engvar'] = true, }, ['params_langx_t'] = { -- unique to {{langx}} [1] = true, -- alias of |code= [2] = true, -- alias of |text= [3] = true, -- alias of |translit= [4] = true, -- alias of |translation= }, ['params_lang_xx_t'] = { -- unique to {{lang-xx}} [1] = true, -- alias of |text= [2] = true, -- alias of |translit= [3] = true, -- alias of |translation= ['script'] = true, -- these needed to override default params in {{lang-??}} templates ['region'] = true, ['variant'] = true, }, } --[[--------------------------< P A R A M E T E R _ V A L I D A T E >------------------------------------------ ]] local function parameter_validate (args_t, template) local err_msg = 'invalid parameter: &#124;%s='; if templates.lang == template then -- for {{lang}} for param, _ in pairs (args_t) do if not known_params_t.params_lang_t[param] and -- unique {{lang}} parameters not known_params_t.common_params_all_t[param] then -- common to all return string.format (err_msg, param); -- <param> not found so abandon end end elseif templates.langx == template then -- for {{langx}} for param, _ in pairs (args_t) do if not known_params_t.params_langx_t[param] and -- unique {{langx}} parameters not known_params_t.params_x_t[param] and -- common to {{langx}} and {{lang-xx}} not known_params_t.common_params_all_t[param] then -- common to all return string.format (err_msg, param); -- <param> not found so abandon end end elseif templates.langxx == template then -- for {{lang-xx}} for param, _ in pairs (args_t) do if not known_params_t.params_lang_xx_t[param] and -- unique {{lang-xx}} parameters not known_params_t.params_x_t[param] and -- common to {{langx}} and {{lang-xx}} not known_params_t.common_params_all_t[param] then -- common to all return string.format (err_msg, param); -- <param> not found so abandon end end end end --[[--------------------------< I S _ S E T >------------------------------------------------------------------ Returns true if argument is set; false otherwise. Argument is 'set' when it exists (not nil) or when it is not an empty string. ]] local function is_set( var ) return not (var == nil or var == ''); end --[[--------------------------< I N V E R T _ I T A L I C S >------------------------------------------------- This function attempts to invert the italic markup a args.text by adding/removing leading/trailing italic markup in args.text. Like |italic=unset, |italic=invert disables automatic italic markup. Individual leading/trailing apostrophes are converted to their html numeric entity equivalent so that the new italic markup doesn't become bold markup inadvertently. Leading and trailing wiki markup is extracted from args.text into separate table elements. Addition, removal, replacement of wiki markup is handled by a string.gsub() replacement table operating only on these separate elements. In the string.gsub() matching pattern, '.*' matches empty string as well as the three expected wiki markup patterns. This function expects that markup in args.text is complete and correct; if it is not, oddness may result. ]] local function invert_italics (source) local invert_pattern_table = { -- leading/trailing markup add/remove/replace patterns [""]="\'\'", -- empty string becomes italic markup ["\'\'"]="", -- italic markup becomes empty string ["\'\'\'"]="\'\'\'\'\'", -- bold becomes bold italic ["\'\'\'\'\'"]="\'\'\'", -- bold italic become bold }; local seg = {}; source = source:gsub ("%f[\']\'%f[^\']", '&#39;'); -- protect single quote marks from being interpreted as bold markup seg[1] = source:match ('^(\'\'+%f[^\']).+') or ''; -- get leading markup, if any; ignore single quote seg[3] = source:match ('.+(%f[\']\'\'+)$') or ''; -- get trailing markup, if any; ignore single quote if '' ~= seg[1] and '' ~= seg[3] then -- extract the 'text' seg[2] = source:match ('^\'\'+%f[^\'](.+)%f[\']\'\'+$') -- from between leading and trailing markup elseif '' ~= seg[1] then seg[2] = source:match ('^\'\'+%f[^\'](.+)') -- following leading markup elseif '' ~= seg[3] then seg[2] = source:match ('(.+)%f[\']\'\'+$') -- preceding trailing markup else seg[2] = source -- when there is no markup end seg[1] = invert_pattern_table[seg[1]] or seg[1]; -- replace leading markup according to pattern table seg[3] = invert_pattern_table[seg[3]] or seg[3]; -- replace leading markup according to pattern table return table.concat (seg); -- put it all back together and done end --[[--------------------------< V A L I D A T E _ I T A L I C >------------------------------------------------ validates |italic= or |italics= assigned values. When |italic= is set and has an acceptible assigned value, return the matching css font-style property value or, for the special case 'default', return nil. When |italic= is not set, or has an unacceptible assigned value, return nil and a nil error message. When both |italic= and |italics= are set, returns nil and a 'conflicting' error message. The return value nil causes the calling lang, lang_xx, or transl function to set args.italic according to the template's defined default ('inherit' for {{lang}}, 'inherit' or 'italic' for {{lang-??}} depending on the individual template's requirements, 'italic' for {{transliteration}}) or to the value appropriate to |script=, if set ({{lang}} and {{lang-??}} only). Accepted values and the values that this function returns are are: nil - when |italic= absent or not set; returns nil default - for completeness, should rarely if ever be used; returns nil yes - force args.text to be rendered in italic font; returns 'italic' no - force args.text to be rendered in normal font; returns 'normal' unset - disables font control so that font-style applied to text is dictated by markup inside or outside the template; returns 'inherit' invert - disables font control so that font-style applied to text is dictated by markup outside or inverted inside the template; returns 'invert' ]] local function validate_italic (args) local properties = {['yes'] = 'italic', ['no'] = 'normal', ['unset'] = 'inherit', ['invert'] = 'invert', ['default'] = nil}; local count = 0 for _, arg in pairs {'italic', 'italics', 'i'} do if args[arg] then count = count + 1 end end if count > 1 then -- return nil and an error message if more than one is set return nil, 'only one of |italic=, |italics=, or |i= can be specified'; end return properties[args.italic or args.italics or args.i], nil; -- return an appropriate value and a nil error message end --[=[--------------------------< V A L I D A T E _ C A T _ A R G S >---------------------------------------------------------- Default behavior of the {{lang}} and {{lang-??}} templates is to add categorization when the templates are used in mainspace. This default functionality may be suppressed by setting |nocat=yes or |cat=no. This function selects one of these two parameters to control categorization. Because having two parameters with 'opposite' names and 'opposite' values is confusing, this function accepts only affirmative values for |nocat= and only negative values for |cat=; in both cases the 'other' sense (and non-sense) is not accepted and the parameter is treated as if it were not set in the template. Sets args.nocat to true if categorization is to be turned off; to nil if the default behavior should apply. Accepted values for |nocat= are the text strings: 'yes', 'y', 'true', 't', on, '1' -- [[Module:Yesno]] returns logical true for all of these; false or nil else for |cat= 'no', 'n', 'false', 'f', 'off', '0' -- [[Module:Yesno]] returns logical false for all of these; true or nil else ]=] local function validate_cat_args (args) if not (args.nocat or args.cat) then -- both are nil, so categorize return; end if false == yesno (args.cat) or true == yesno (args.nocat) then args.nocat = true; -- set to true when args.nocat is affirmative; nil else (as if the parameter were not set in the template) else -- args.nocat is the parameter actually used. args.nocat = nil; end end --[[--------------------------< I N _ A R R A Y >-------------------------------------------------------------- Whether needle is in haystack ]] local function in_array ( needle, haystack ) if needle == nil then return false; end for n,v in ipairs( haystack ) do if v == needle then return n; end end return false; end --[[--------------------------< F O R M A T _ I E T F _ T A G >------------------------------------------------ prettify ietf tags to use recommended subtag formats: code: lower case script: sentence case region: upper case variant: lower case private: lower case prefixed with -x- ]] local function format_ietf_tag (code, script, region, variant, private) local out = {}; if is_set (private) then return table.concat ({code:lower(), 'x', private:lower()}, '-'); -- if private, all other tags ignored end table.insert (out, code:lower()); if is_set (script) then script = script:lower():gsub ('^%a', string.upper); table.insert (out, script); end if is_set (region) then table.insert (out, region:upper()); end if is_set (variant) then table.insert (out, variant:lower()); end return table.concat (out, '-'); end --[[--------------------------< G E T _ I E T F _ P A R T S >-------------------------------------------------- extracts and returns IETF language tag parts: primary language subtag (required) - 2 or 3 character IANA language code script subtag - four character IANA script code region subtag - two-letter or three digit IANA region code variant subtag - four digit or 5-8 alnum variant code; only one variant subtag supported private subtag - x- followed by 1-8 alnum private code; only supported with the primary language tag in any one of these forms lang lang-variant lang-script lang-script-variant lang-region lang-region-variant lang-script-region lang-script-region-variant lang-x-private each of lang, script, region, variant, and private, when used, must be valid Languages with both two- and three-character code synonyms are promoted to the two-character synonym because the IANA registry file omits the synonymous three-character code; we cannot depend on browsers understanding the synonymous three-character codes in the lang= attribute. For {{lang-??}} templates, the parameters |script=, |region=, and |variant= are supported (not supported in {{lang}} because those parameters are superfluous to the IETF subtags in |code=) returns six values; all lower case. Valid parts are returned as themselves; omitted parts are returned as empty strings, invalid parts are returned as nil; the sixth returned item is an error message (if an error detected) or nil. see http://www.rfc-editor.org/rfc/bcp/bcp47.txt section 2.1 ]] local function get_ietf_parts (source, args_script, args_region, args_variant) local code, script, region, variant, private; -- ietf tag parts if not is_set (source) then return nil, nil, nil, nil, nil, 'missing language tag'; end local pattern = { -- table of tables holding acceptibe ietf tag patterns and short names of the ietf part captured by the pattern {'^(%a%a%a?)%-(%a%a%a%a)%-(%a%a)%-(%d%d%d%d)$', 's', 'r', 'v'}, -- 1 - ll-Ssss-RR-variant (where variant is 4 digits) {'^(%a%a%a?)%-(%a%a%a%a)%-(%d%d%d)%-(%d%d%d%d)$', 's', 'r', 'v'}, -- 2 - ll-Ssss-DDD-variant (where region is 3 digits; variant is 4 digits) {'^(%a%a%a?)%-(%a%a%a%a)%-(%a%a)%-(%w%w%w%w%w%w?%w?%w?)$', 's', 'r', 'v'}, -- 3 - ll-Ssss-RR-variant (where variant is 5-8 alnum characters) {'^(%a%a%a?)%-(%a%a%a%a)%-(%d%d%d)%-(%w%w%w%w%w%w?%w?%w?)$', 's', 'r', 'v'}, -- 4 - ll-Ssss-DDD-variant (where region is 3 digits; variant is 5-8 alnum characters) {'^(%a%a%a?)%-(%a%a%a%a)%-(%d%d%d%d)$', 's', 'v'}, -- 5 - ll-Ssss-variant (where variant is 4 digits) {'^(%a%a%a?)%-(%a%a%a%a)%-(%w%w%w%w%w%w?%w?%w?)$', 's', 'v'}, -- 6 - ll-Ssss-variant (where variant is 5-8 alnum characters) {'^(%a%a%a?)%-(%a%a)%-(%d%d%d%d)$', 'r', 'v'}, -- 7 - ll-RR-variant (where variant is 4 digits) {'^(%a%a%a?)%-(%d%d%d)%-(%d%d%d%d)$', 'r', 'v'}, -- 8 - ll-DDD-variant (where region is 3 digits; variant is 4 digits) {'^(%a%a%a?)%-(%a%a)%-(%w%w%w%w%w%w?%w?%w?)$', 'r', 'v'}, -- 9 - ll-RR-variant (where variant is 5-8 alnum characters) {'^(%a%a%a?)%-(%d%d%d)%-(%w%w%w%w%w%w?%w?%w?)$', 'r', 'v'}, -- 10 - ll-DDD-variant (where region is 3 digits; variant is 5-8 alnum characters) {'^(%a%a%a?)%-(%d%d%d%d)$', 'v'}, -- 11 - ll-variant (where variant is 4 digits) {'^(%a%a%a?)%-(%w%w%w%w%w%w?%w?%w?)$', 'v'}, -- 12 - ll-variant (where variant is 5-8 alnum characters) {'^(%a%a%a?)%-(%a%a%a%a)%-(%a%a)$', 's', 'r'}, -- 13 - ll-Ssss-RR {'^(%a%a%a?)%-(%a%a%a%a)%-(%d%d%d)$', 's', 'r'}, -- 14 - ll-Ssss-DDD (region is 3 digits) {'^(%a%a%a?)%-(%a%a%a%a)$', 's'}, -- 15 - ll-Ssss {'^(%a%a%a?)%-(%a%a)$', 'r'}, -- 16 - ll-RR {'^(%a%a%a?)%-(%d%d%d)$', 'r'}, -- 17 - ll-DDD (region is 3 digits) {'^(%a%a%a?)$'}, -- 18 - ll {'^(%a%a%a?)%-x%-(%w%w?%w?%w?%w?%w?%w?%w?)$', 'p'}, -- 19 - ll-x-pppppppp (private is 1-8 alnum characters) } local t = {}; -- table of captures; serves as a translator between captured ietf tag parts and named variables for i, v in ipairs (pattern) do -- spin through the pattern table looking for a match local c1, c2, c3, c4; -- captures in the 'pattern' from the pattern table go here c1, c2, c3, c4 = source:match (pattern[i][1]); -- one or more captures set if source matches pattern[i]) if c1 then -- c1 always set on match code = c1; -- first capture is always code t = { [pattern[i][2] or 'x'] = c2, -- fill the table of captures with the rest of the captures [pattern[i][3] or 'x'] = c3, -- take index names from pattern table and assign sequential captures [pattern[i][4] or 'x'] = c4, -- index name may be nil in pattern[i] table so "or 'x'" spoofs a name for this index in this table }; script = t.s or ''; -- translate table contents to named variables; region = t.r or ''; -- absent table entries are nil so set named ietf parts to empty string for concatenation variant= t.v or ''; private = t.p or ''; break; -- and done end end if not code then return nil, nil, nil, nil, nil, table.concat ({'unrecognized language tag: ', source}); -- don't know what we got but it is malformed end code = code:lower(); -- ensure that we use and return lower case version of this if not (override_table[code] or lang_table[code] or synonym_table[code] or lang_dep_table[code]) then return nil, nil, nil, nil, nil, table.concat ({'unrecognized language code: ', code}); -- invalid language code, don't know about the others (don't care?) end if synonym_table[code] then -- if 639-2/639-2T code has a 639-1 synonym table.insert (maint_cats, table.concat ({'Lang and lang-xx code promoted to ISO 639-1|', code})); table.insert (maint_msgs, table.concat ({'code: ', code, ' promoted to code: ', synonym_table[code]})); code = synonym_table[code]; -- use the synonym end if is_set (script) then if is_set (args_script) then return code, nil, nil, nil, nil, 'redundant script tag'; -- both code with script and |script= not allowed end else script = args_script or ''; -- use args.script if provided end if is_set (script) then script = script:lower(); -- ensure that we use and return lower case version of this if not script_table[script] then return code, nil, nil, nil, nil, table.concat ({'unrecognized script: ', script, ' for code: ', code}); -- language code ok, invalid script, don't know about the others (don't care?) end end if suppressed_table[script] then -- ensure that code-script does not use a suppressed script if in_array (code, suppressed_table[script]) then return code, nil, nil, nil, nil, table.concat ({'script: ', script, ' not supported for code: ', code}); -- language code ok, script is suppressed for this code end end if is_set (region) then if is_set (args_region) then return code, nil, nil, nil, nil, 'redundant region tag'; -- both code with region and |region= not allowed end else region = args_region or ''; -- use args.region if provided end if is_set (region) then region = region:lower(); -- ensure that we use and return lower case version of this if not region_table[region] then return code, script, nil, nil, nil, table.concat ({'unrecognized region: ', region, ' for code: ', code}); end end if is_set (variant) then if is_set (args_variant) then return code, nil, nil, nil, nil, 'redundant variant tag'; -- both code with variant and |variant= not allowed end else variant = args_variant or ''; -- use args.variant if provided end if is_set (variant) then variant = variant:lower(); -- ensure that we use and return lower case version of this if not variant_table[variant] then -- make sure variant is valid return code, script, region, nil, nil, table.concat ({'unrecognized variant: ', variant}); end -- does this duplicate/replace tests in lang() and lang_xx()? if is_set (script) then -- if script set it must be part of the 'prefix' if not in_array (table.concat ({code, '-', script}), variant_table[variant]['prefixes']) then return code, script, region, nil, nil, table.concat ({'unrecognized variant: ', variant, ' for code-script pair: ', code, '-', script}); end elseif is_set (region) then -- if region set, there are some prefixes that require lang code and region (en-CA-newfound) if not in_array (code, variant_table[variant]['prefixes']) then -- first see if lang code is all that's required (en-oxendict though en-GB-oxendict is preferred) if not in_array (table.concat ({code, '-', region}), variant_table[variant]['prefixes']) then -- now try for lang code and region (en-CA-newfound) return code, script, region, nil, nil, table.concat ({'unrecognized variant: ', variant, ' for code-region pair: ', code, '-', region}); end end else -- cheap way to determine if there are prefixes; fonipa and others don't have prefixes; # operator always returns 0 if variant_table[variant]['prefixes'][1] and not in_array (code, variant_table[variant]['prefixes']) then return code, script, region, nil, nil, table.concat ({'unrecognized variant: ', variant, ' for code: ', code}); end end end if is_set (private) then private = private:lower(); -- ensure that we use and return lower case version of this if not override_table[table.concat ({code, '-x-', private})] then -- make sure private tag is valid; note that index return code, script, region, nil, nil, table.concat ({'unrecognized private tag: ', private}); end end return code, script, region, variant, private, nil; -- return the good bits; make sure that msg is nil end --[[--------------------------< S U B S T I T U T E >---------------------------------------------------------- substitutes $1, $2, etc in <message> with data from <data_t>. Returns plain-text substituted string when <data_t> not nil; returns <message> else ]] local function substitute (message, data_t) return data_t and mw.message.newRawMessage (message, data_t):plain() or message; end --[[--------------------------< M A K E _ E R R O R _ M S G >-------------------------------------------------- assembles an error message from template name, message text, help link, and error category. ]] local function make_error_msg (msg, args_t, template) local category; local text; -- handle the oddity that is {{langx}} if templates.langxx == template then text = args_t.text or args_t[1]; -- for {{lang-xx}} else text = args_t.text or args_t[2]; -- for {{lang}}, {{langx}}, and {{transliteration}} end if 'Transliteration' == template then category = 'Transliteration'; else category = 'Lang and lang-xx' end local category_link = ((0 == namespace or 10 == namespace) and not args_t.nocat) and table.concat ({'[[Category:', category, ' template errors]]'}) or ''; return substitute ('[$1] <span style="color:#d33">Error: {{$2}}: $3 ([[:Category:$4 template errors|help]])</span>$5', { text or 'undefined', template, msg, category, category_link }) end --[=[-------------------------< M A K E _ W I K I L I N K >---------------------------------------------------- Makes a wikilink; when both link and display text is provided, returns a wikilink in the form [[L|D]]; if only link is provided, returns a wikilink in the form [[L]]; if neither are provided or link is omitted, returns an empty string. ]=] local function make_wikilink (link, display) if is_set (link) then if is_set (display) then return table.concat ({'[[', link, '|', display, ']]'}); else return table.concat ({'[[', link, ']]'}); end else return ''; end end --[[--------------------------< D I V _ M A R K U P _ A D D >-------------------------------------------------- adds <i> and </i> tags to list-item text or to implied <p>..</p> text. mixed not supported ]] local function div_markup_add (text, style) local implied_p = {}; if text:find ('^\n[%*:;#]') then -- look for list markup; list markup must begin at start of text if 'italic' == style then return text:gsub ('(\n[%*:;#]+)([^\n]+)', '%1<i>%2</i>'); -- insert italic markup at each list item else return text; end end if text:find ('\n+') then -- look for any number of \n characters in text text = text:gsub ('([^\n])\n([^\n])', '%1 %2'); -- replace single newline characters with a space character which mimics mediawiki if 'italic' == style then text = text:gsub('[^\n]+', '<p><i>%1</i></p>'); -- insert p and italic markup tags at each impled p (two or more consecutive '\n\n' sequences) else text = text:gsub ('[^\n]+', '<p>%1</p>'); -- insert p markup at each impled p text = text:gsub ('\n', ''); -- strip newline characters end end return text; end --[[--------------------------< T I T L E _ W R A P P E R _ M A K E >------------------------------------------ makes a <span title="<title text>"><content_text></span> or <div title="<title text>"><content_text></div> where <title text> is in the tool-tip in the wiki's local language and <content_text> is non-local-language text in html markup. This because the lang= attibute applies to the content of its enclosing tag. <tag> holds a string 'div' or 'span' used to choose the correct wrapping tag ]] local function title_wrapper_make (title_text, content_text, tag) local wrapper_t = {}; table.insert (wrapper_t, table.concat ({'<', tag})); -- open opening wrapper tag table.insert (wrapper_t, ' title=\"'); -- begin title attribute table.insert (wrapper_t, title_text); -- add <title_text> table.insert (wrapper_t, '\">'); -- end title attribute and close opening wrapper tag table.insert (wrapper_t, content_text); -- add <content_text> table.insert (wrapper_t, table.concat ({'</', tag, '>'})); -- add closing wrapper tag return table.concat (wrapper_t); -- make a big string and done end --[[--------------------------< M A K E _ T E X T _ H T M L >-------------------------------------------------- Add the html markup to text according to the type of content that it is: <span> or <i> tags for inline content or <div> tags for block content The lang= attribute also applies to the content of the tag where it is placed so this is wrong because 'Spanish language text' is English: <i lang="es" title="Spanish language text">casa</i> should be: <span title="Spanish language text"><i lang="es">casa</i></span> or for <div>...</div>: <div title="Spanish language text"><div lang="es"><spanish-language-text></div></div> ]] local function make_text_html (code, text, tag, rtl, style, size, language) local html_t = {}; local style_added = ''; local wrapper_tag = tag; -- <tag> gets modified so save a copy for use when/if we create a wrapper span or div if text:match ('^%*') then table.insert (html_t, '&#42;'); -- move proto language text prefix outside of italic markup if any; use numeric entity because plain splat confuses MediaWiki text = text:gsub ('^%*', ''); -- remove the splat from the text end if 'span' == tag then -- default html tag for inline content if 'italic' == style then -- but if italic tag = 'i'; -- change to <i> tags end else -- must be div so go text = div_markup_add (text, style); -- handle implied <p>, implied <p> with <i>, and list markup (*;:#) with <i> end table.insert (html_t, table.concat ({'<', tag})); -- open the <i>, <span>, or <div> html tag code = code:gsub ('%-x%-.*', ''); -- strip private use subtag from code tag because meaningless outside of wikipedia table.insert (html_t, table.concat ({' lang="', code, '\"'})); -- add language attribute if (rtl or unicode.is_rtl(text)) and ('ltr' == this_wiki_lang_dir) then -- text is right-to-left on a left-to-right wiki table.insert (html_t, ' dir="rtl"'); -- add direction attribute for right-to-left languages elseif not (rtl or unicode.is_rtl(text)) and ('rtl' == this_wiki_lang_dir) then -- text is left-to-right on a right-to-left wiki table.insert (html_t, ' dir="ltr"'); -- add direction attribute for left-to-right languages end if 'normal' == style then -- when |italic=no table.insert (html_t, ' style=\"font-style: normal;'); -- override external markup, if any style_added = '\"'; -- remember that style attribute added and is not yet closed end if is_set (size) then -- when |size=<something> if is_set (style_added) then table.insert (html_t, table.concat ({' font-size: ', size, ';'})); -- add when style attribute already inserted else table.insert (html_t, table.concat ({' style=\"font-size: ', size, ';'})); -- create style attribute style_added = '\"'; -- remember that style attribute added and is not yet closed end end table.insert (html_t, table.concat ({style_added, '>'})); -- close the opening html tag table.insert (html_t, text); -- insert the text table.insert (html_t, table.concat ({'</', tag, '>'})); -- close the 'text' <i>, <span>, or <div> html tag if is_set (language) then -- create a <title_text> string for the title= attribute in a wrapper span or div local title_text; if 'zxx' == code then -- special case for this tag 'no linguistic content' title_text = table.concat ({language, ' text'}); -- not a language so don't use 'language' in title text elseif mw.ustring.find (language, 'languages', 1, true) then title_text = table.concat ({language, ' collective text'}); -- for collective languages else title_text = table.concat ({language, '-language text'}); -- for individual languages end return title_wrapper_make (title_text, table.concat (html_t), wrapper_tag); else return table.concat (html_t); end end --[=[-------------------------< M A K E _ C A T E G O R Y >---------------------------------------------------- For individual language, <language>, returns: [[Category:Articles containing <language>-language text]] for English: [[Category:Articles containing explicitly cited English-language text]] for ISO 639-2 collective languages (and for 639-1 bh): [[Category:Articles with text in <language> languages]] ]=] local function make_category (code, language_name, nocat, name_get) local cat = {}; local retval; if ((0 ~= namespace) or nocat) and not name_get then -- only categorize in article space return ''; -- return empty string for concatenation end if mw.ustring.find (language_name, 'languages', 1, true) then return table.concat ({'[[Category:Articles with text in ', language_name, ']]'}); end table.insert (cat, '[[Category:Articles containing '); if this_wiki_lang_tag == code then table.insert (cat, 'explicitly cited ' .. language_name); -- unique category name for the local language else table.insert (cat, language_name); end table.insert (cat, '-language text]]'); return table.concat (cat); end --[[--------------------------< M A K E _ T R A N S L I T >---------------------------------------------------- return translit <i lang=xx-Latn>...</i> where xx is the language code; else return empty string The value |script= is not used in {{transliteration}} for this purpose; instead it uses |code. Because language scripts are listed in the {{transliteration}} switches they are included in the data tables. The script parameter is introduced at {{Language with name and transliteration}}. If |script= is set, this function uses it in preference to code. To avoid confusion, in this module and the templates that use it, the transliteration script parameter is renamed to be |translit-script= (in this function, tscript) This function is used by both lang_xx() and transl() lang_xx() always provides code, language_name, and translit; may provide tscript; never provides style transl() always provides language_name, translit, and one of code or tscript, never both; always provides style For {{transliteration}}, style only applies when a language code is provided ]] local function make_translit (code, language_name, translit, std, tscript, style, engvar) local title; local out_t = {}; local title_t = lang_data.translit_title_table; -- table of transliteration standards and the language codes and scripts that apply to those standards local title_text = ''; -- tool tip text for title= attribute std = std and std:lower(); -- lower case for table indexing if not is_set (std) and not is_set (tscript) then -- when neither standard nor script specified title_text = language_name; -- write a generic tool tip if not mw.ustring.find (language_name, 'languages', 1, true) then -- collective language names (plural 'languages' is part of the name) title_text = title_text .. '-language'; -- skip this text (individual and macro languages only) end title_text = substitute ('$1 $2', {title_text, lang_data.engvar_t[engvar]['romanisz_lc']}); -- finish the tool tip; use romanization when neither script nor standard supplied elseif is_set (std) and is_set (tscript) then -- when both are specified if title_t[std] then -- and if standard is legitimate if title_t[std][tscript] then -- and if script for that standard is legitimate if script_table[tscript] then title_text = title_text .. table.concat ({title_t[std][tscript:lower()], ' (', script_table[tscript], ' script) transliteration'}); -- add the appropriate text to the tool tip else title_text = title_text .. title_t[std]['default']; -- use the default if script not in std table; TODO: maint cat? error message because script not found for this standard? end else title_text = title_text .. title_t[std]['default']; -- use the default if script not in std table; TODO: maint cat? error message because script not found for this standard? end else return ''; -- invalid standard, setup for error message end elseif is_set (std) then -- translit-script not set, use language code if not title_t[std] then return ''; end -- invalid standard, setup for error message if title_t[std][code] then -- if language code is in the table (transl may not provide a language code) title_text = title_text .. table.concat ({title_t[std][code:lower()], ' (', language_name, ' language) transliteration'}); -- add the appropriate text to the tool tip else -- code doesn't match title_text = title_text .. title_t[std]['default']; -- so use the standard's default end else -- here if translit-script set but translit-std not set if title_t['no_std'][tscript] then title_text = title_text .. title_t['no_std'][tscript]; -- use translit-script if set elseif title_t['no_std'][code] then title_text = title_text .. title_t['no_std'][code]; -- use language code else if is_set (tscript) then title_text = title_text .. table.concat ({language_name, '-script transliteration'}); -- write a script tool tip elseif is_set (code) then if not mw.ustring.find (language_name, 'languages', 1, true) then -- collective language names (plural 'languages' is part of the name) title_text = title_text .. '-language'; -- skip this text (individual and macro languages only) end title_text = title_text .. ' transliteration'; -- finish the tool tip else title_text = title_text .. ' transliteration'; -- generic tool tip (can we ever get here?) end end end local close_tag; if is_set (code) then -- when a language code is provided (always with {{lang-??}} templates, not always with {{transliteration}}) code = code:match ('^(%a%a%a?)'); -- strip all subtags leaving only the language subtag if not style then -- nil for the default italic style table.insert (out_t, "<i lang=\""); -- so use <i> tag close_tag = '</i>'; -- tag to be used when closing else table.insert (out_t, table.concat ({'<span style=\"font-style: ', style, '\" lang=\"'})); -- non-standard style, construct a span tag for it close_tag = '</span>'; -- tag to be used when closing end table.insert (out_t, code); table.insert (out_t, "-Latn\">"); -- transliterations are always Latin script else table.insert (out_t, "<span>"); -- when no language code: no lang= attribute, not italic ({{transliteration}} only) close_tag = '</span>'; end table.insert (out_t, translit); -- add the translit text table.insert (out_t, close_tag); -- and add the appropriate </i> or </span> if '' == title_text then -- when there is no need for a tool-tip return table.concat (out_t); -- make a string and done else title_text = 'gb_t' == engvar and title_text:gsub ('([Rr]omani)z', '%1s') or title_text; -- gb eng when engvar specifies gb eng; us eng else return title_wrapper_make (title_text, table.concat (out_t), 'span'); -- wrap with a tool-tip span and done end end --[[--------------------------< V A L I D A T E _ T E X T >---------------------------------------------------- This function checks the content of args.text and returns empty string if nothing is amiss else it returns an error message. The tests are for empty or missing text and for improper or disallowed use of apostrophe markup. Italic rendering is controlled by the |italic= template parameter so italic markup should never appear in args.text either as ''itself'' or as '''''bold italic''''' unless |italic=unset or |italic=invert. ]] local function validate_text (template, args) if not is_set (args.text) then return make_error_msg ('no text', args, template); end if args.text:find ("%f[\']\'\'\'\'%f[^\']") or args.text:find ("\'\'\'\'\'[\']+") then -- because we're looking, look for 4 appostrophes or 6+ appostrophes return make_error_msg ('text has malformed markup', args, template); end local style = args.italic; if ('unset' ~= style) and ('invert' ~=style) then if args.text:find ("%f[\']\'\'%f[^\']") or args.text:find ("%f[\']\'\'\'\'\'%f[^\']") then -- italic but not bold, or bold italic return make_error_msg ('text has italic markup', args, template); end end end --[[--------------------------< R E N D E R _ M A I N T >------------------------------------------------------ render mainenance messages and categories ]] local function render_maint (nocat) local maint = {}; if 0 < #maint_msgs then -- when there are maintenance messages table.insert (maint, table.concat ({'<span class="lang-comment" style="font-style: normal; display: none; color: #33aa33; margin-left: 0.3em;">'})); -- opening <span> tag for _, msg in ipairs (maint_msgs) do table.insert (maint, table.concat ({msg, ' '})); -- add message strings end table.insert (maint, '</span>'); -- close the span end if (0 < #maint_cats) and (0 == namespace) and not nocat then -- when there are maintenance categories; article namespace only for _, cat in ipairs (maint_cats) do table.insert (maint, table.concat ({'[[Category:', cat, ']]'})); -- format and add the categories end end return table.concat (maint); end --[[--------------------------< P R O T O _ P R E F I X >------------------------------------------------------ for proto languages, text is prefixed with a splat. We do that here as a flag for make_text_html() so that a splat will be rendered outside of italic markup (if used). If the first character in text here is already a splat, we do nothing proto_param is boolean or nil; true adds splat prefix regardless of language name; false removes and / or inhibits regardless of language name; nil does nothing; presumes that the value in text is correct but removes extra splac ]] local function proto_prefix (text, language_name, proto_param) if false == proto_param then -- when forced by |proto=no return text:gsub ('^%**', ''); -- return text without splat prefix regardless of language name or existing splat prefix in text elseif (language_name:find ('^Proto%-') or (true == proto_param)) then -- language is a proto or forced by |proto=yes return text:gsub ('^%**', '*'); -- prefix proto-language text with a splat; also removes duplicate prefixing splats end return text:gsub ('^%*+', '*'); -- return text unmolested except multiple splats reduced to one splat end --[[--------------------------< H A S _ P O E M _ T A G >------------------------------------------------------ looks for a poem strip marker in text; returns true when found; false else auto-italic detection disabled when text has poem stripmarker because it is not possible for this code to know the content that will replace the stripmarker. ]] local function has_poem_tag (text) return text:find ('\127[^\127]*UNIQ%-%-poem%-[%a%d]+%-QINU[^\127]*\127') and true or false; end --[[--------------------------< H T M L _ T A G _ S E L E C T >------------------------------------------------ Inspects content of and selectively trims text. Returns text and the name of an appropriate html tag for text. If text contains: \n\n text has implied <p>..</p> tags - trim leading and trailing whitespace and return If text begins with list markup: \n* unordered \n; definition \n: definition \n# ordered trim all leading whitespace except \n and trim all trailing whitespace If text contains <poem>...</poem> stripmarker, return text unmodified and choose <div>..</div> tags because the stripmarker is replaced with text wrapped in <div>..</div> tags. If the text contains any actual <div>...</div> tags, then it's again returned unmodified and <div>...</div> tags are used to wrap it, to prevent div/span inversion. ]] local function html_tag_select (text) local tag; if has_poem_tag (text) then -- contains poem stripmarker (we can't know the content of that) tag = 'div'; -- poem replacement is in div tags so lang must use div tags elseif text:find ('<div') then -- reductive; if the text contains a div tag, we must use div tags tag = 'div'; elseif mw.text.trim (text):find ('\n\n+') then -- contains implied p tags text = mw.text.trim (text); -- trim leading and trailing whitespace characters tag = 'div'; -- must be div because span may not contain p tags (added later by MediaWiki); poem replacement is in div tags elseif text:find ('\n[%*:;%#]') then -- if text has list markup text = text:gsub ('^[\t\r\f ]*', ''):gsub ('%s*$', ''); -- trim all whitespace except leading newline character '\n' tag = 'div'; -- must be div because span may not contain ul, dd, dl, ol tags (added later by MediaWiki) else text = mw.text.trim (text); -- plain text tag = 'span'; -- so span is fine end return text, tag; end --[[--------------------------< V A L I D A T E _ P R O T O >-------------------------------------------------- validates value assigned to |proto=; permitted values are yes and no; yes returns as true, no returns as false, empty string (or parameter omitted) returns as nil; any other value returns as nil with a second return value of true indicating that some other value has been assigned to |proto= ]] local function validate_proto (proto_param) if 'yes' == proto_param then return true; elseif 'no' == proto_param then return false; elseif is_set (proto_param) then return nil, true; -- |proto= something other than 'yes' or 'no' else return nil; -- missing or empty end end --[[--------------------------< L A N G U A G E _ N A M E _ G E T >-------------------------------------------- common function to return language name from the data set according to IETF tag returns language name if found in data tables; nil else ]] local function language_name_get (ietf, code, cat) ietf = ietf:lower(); -- ietf:lower() because format_ietf_tag() returns mixed case local name; -- remains nil if not found if override_table[ietf] then -- look for whole IETF tag in override table name = override_table[ietf]; elseif override_table[code] then -- not there so try basic language tag name = override_table[code]; elseif lang_table[code] then -- shift to iana active tag/name table name = lang_table[code]; elseif lang_dep_table[code] then -- try the iana deprecated tag/name table name = lang_dep_table[code]; end if lang_dep_table[code] and cat then -- because deprecated code may have been overridden to en.wiki preferred name table.insert (maint_cats, table.concat ({'Lang and lang-xx using deprecated ISO 639 codes|', code})); table.insert (maint_msgs, table.concat ({'code: ', code, ' is deprecated'})); end return name; -- name from data tables or nil end --[[--------------------------< T E X T _ S C R I P T _ M A T C H _ T E X T >---------------------------------- IETF script subtag should match the script of the <text>. This module does not attempt to know all scripts and what they look like. It does know what Latn script look like so when <text> is written using other than the Latn script, the IETF script, if present, should not be Latn. Conversely, when <text> is written using the Latn script, the IETF script, if present, should be Latn. returns an error message when mismatch detected; nil else ]] local function text_script_match_test (script, is_latn_text) --error (script) if is_set (script) then -- don't bother with the rest of this if <script> is nil or empty string if is_latn_text then -- when text is wholly Latn script if ('Latn' ~= script and 'latn' ~= script) then -- but a non-Latn script is specified return 'Latn text/non-Latn script subtag mismatch'; -- emit an error message end else -- when text is not wholly Latn script if ('Latn' == script or 'latn' == script) then -- but Latn script is specified return 'Non-latn text/Latn script subtag mismatch'; -- emit an error message end end end end --[[--------------------------< _ L A N G >-------------------------------------------------------------------- entry point for {{lang}} there should be no reason to set parameters in the {{lang}} {{#invoke:}} <includeonly>{{#invoke:lang|lang}}</includeonly> parameters are received from the template's frame (parent frame) ]] local function _lang (args) local out = {}; local language_name; -- used to make category names local category_name; -- same as language_name except that it retains any parenthetical disambiguators (if any) from the data set local subtags = {}; -- IETF subtags script, region, variant, and private local code; -- the language code local msg; -- for error messages local tag = 'span'; -- initial value for make_text_html() local template = args.template or templates.lang; maint_cats = {}; -- initialize because when this module required into another module, these only declared once so only initialzed once maint_msgs = {}; validate_cat_args (args); -- determine if categorization should be suppressed if args[1] and args.code then return make_error_msg ('conflicting: {{{1}}} and |code=', args, template); else args.code = args[1] or args.code; -- prefer args.code end if args[2] and args.text then return make_error_msg ('conflicting: {{{2}}} and |text=', args, template); else args.text = args[2] or args.text; -- prefer args.text end -- msg = parameter_validate (args, templates.lang); -- if msg then -- return make_error_msg (msg, args, templates.lang); -- end msg = validate_text (template, args); -- ensure that |text= is set if is_set (msg) then -- msg is an already-formatted error message return msg; end args.text, tag = html_tag_select (args.text); -- inspects text; returns appropriate html tag with text trimmed accordingly args.rtl = args.rtl == 'yes'; -- convert to boolean: 'yes' -> true, other values -> false args.proto, msg = validate_proto (args.proto); -- return boolean, or nil, or nil and error message flag if msg then return make_error_msg (table.concat ({'invalid |proto=: ', args.proto}), args, template); end code, subtags.script, subtags.region, subtags.variant, subtags.private, msg = get_ietf_parts (args.code); -- |script=, |region=, |variant= not supported because they should be part of args.code ({{{1}}} in {{lang}}) if msg then return make_error_msg ( msg, args, template); end local is_latn_text = unicode.is_Latin (args.text); -- make a boolean msg = text_script_match_test (subtags.script, is_latn_text) if msg then -- if an error detected then there is an error message return make_error_msg (msg, args, template); end args.italic, msg = validate_italic (args); if msg then return make_error_msg (msg, args, template); end if nil == args.italic then -- nil when |italic= absent or not set or |italic=default; args.italic controls if ('latn' == subtags.script) or -- script is latn (this_wiki_lang_tag ~= code and not is_set (subtags.script) and not has_poem_tag (args.text) and is_latn_text) then -- text not this wiki's language, no script specified and not in poem markup but is wholly latn script (auto-italics) args.italic = 'italic'; -- DEFAULT for {{lang}} templates is upright; but if latn script set for font-style:italic else args.italic = 'inherit'; -- italic not set; script not latn; inherit current style end end if is_set (subtags.script) then -- if script set, override rtl setting if in_array (subtags.script, lang_data.rtl_scripts) then args.rtl = true; -- script is an rtl script else args.rtl = false; -- script is not an rtl script end end args.code = format_ietf_tag (code, subtags.script, subtags.region, subtags.variant, subtags.private); -- format to recommended subtag styles language_name = language_name_get (args.code, code, true); -- get language name; try ietf tag first, then code w/o variant then code w/ variant if 'invert' == args.italic and 'span' == tag then -- invert only supported for in-line content args.text = invert_italics (args.text) end args.text = proto_prefix (args.text, language_name, args.proto); -- prefix proto-language text with a splat table.insert (out, make_text_html (args.code, args.text, tag, args.rtl, args.italic, args.size, language_name)); table.insert (out, make_category (code, language_name, args.nocat)); table.insert (out, render_maint (args.nocat)); -- maintenance messages and categories return table.concat (out); -- put it all together and done end --[[--------------------------< L A N G >---------------------------------------------------------------------- entry point for {{lang}} there should be no reason to set parameters in the {{lang}} {{#invoke:}} <includeonly>{{#invoke:lang|lang}}</includeonly> parameters are received from the template's frame (parent frame) ]] local function lang (frame) local args_t = getArgs (frame, { -- this code so that we can detect and handle wiki list markup in text valueFunc = function (key, value) if 2 == key or 'text' == key then -- the 'text' parameter; do not trim wite space return value; -- return untrimmed 'text' elseif value then -- all other values: if the value is not nil value = mw.text.trim (value); -- trim whitespace if '' ~= value then -- empty string when value was only whitespace return value; end end return nil; -- value was empty or contained only whitespace end -- end of valueFunc }); args_t.fn = nil; -- unset because not supported but this function might have been called by {{lang|fn=lang|...}} local msg = parameter_validate (args_t, templates.lang); -- verify that all supplied parameters are supported by {{lang-??}} if msg then return make_error_msg (msg, args_t, templates.lang); -- when template has unsupported params, abandon with error message end return _lang (args_t); end --[[--------------------------< T R A N S L A T I O N _ M A K E >---------------------------------------------- stand-alone function to create literal translation of main text Also used by {{lang-x2}} ]] local function translation_make (args_t) local translation_t = {', '}; -- initialize output if 'none' ~= args_t.label then -- if we want a label table.insert (translation_t, '<small>'); -- open the <small> html tag if 'no' == args_t.link then table.insert (translation_t, '<abbr title="literal translation">lit.</abbr>'); -- unlinked form else table.insert (translation_t, make_wikilink ('Literal translation', 'lit.')); -- linked form end table.insert (translation_t, "&thinsp;</small>"); -- close the <small> html tag end table.insert (translation_t, table.concat ({'&#39;', args_t.translation, '&#39;'})); -- use html entities to avoid wiki markup confusion return table.concat (translation_t); -- make a big string and done end --[[--------------------------< _ L A N G _ X X >-------------------------------------------------------------- For the {{lang-??}} templates, the only parameter required to be set in the template is the language code. All other parameters can, usually should, be written in the template call. For {{lang-??}} templates for languages that can have multiple writing systems, it may be appropriate to set |script= as well. For each {{lang-??}} template choose the appropriate entry-point function so that this function knows the default styling that should be applied to text. For normal, upright style: <includeonly>{{#invoke:lang|lang_xx_inherit|code=xx}}</includeonly> For italic style: <includeonly>{{#invoke:lang|lang_xx_italic|code=xx}}</includeonly> All other parameters should be received from the template's frame (parent frame) Supported parameters are: |code = (required) the IANA language code |script = IANA script code; especially for use with languages that use multiple writing systems |region = IANA region code |variant = IANA variant code |text = (required) the displayed text in language specified by code |link = boolean false ('no') does not link code-spcified language name to associated language article |rtl = boolean true ('yes') identifies the language specified by code as a right-to-left language |nocat = boolean true ('yes') inhibits normal categorization; error categories are not affected |cat = boolian false ('no') opposite form of |nocat= |italic = boolean true ('yes') renders displayed text in italic font; boolean false ('no') renders displayed text in normal font; not set renders according to initial_style_state |lit = text that is a literal translation of text |label = 'none' to suppress all labeling (language name, 'translit.', 'lit.') any other text replaces language-name label - automatic wikilinking disabled for those {{lang-??}} templates that support transliteration (those templates where |text= is not entirely latn script): |translit = text that is a transliteration of text |translit-std = the standard that applies to the transliteration |translit-script = ISO 15924 script name; falls back to code For {{lang-??}}, the positional parameters are: {{{1}}} text {{{2}}} transliterated text {{{3}}} literal translation text no other positional parameters are allowed ]] local function _lang_xx (args, base_template) -- base_template will be either of 'Langx' or 'Lang-xx' local out = {}; local language_name; -- used to make display text, article links local category_name; -- same as language_name except that it retains any parenthetical disambiguators (if any) from the data set local subtags = {}; -- IETF subtags script, region, and variant local code; -- the language code local translit_script_name; -- name associated with IANA (ISO 15924) script code local translit; local translit_title; local msg; -- for error messages local tag = 'span'; -- initial value for make_text_html() local template = args.template or base_template; maint_cats = {}; -- initialize because when this module required into another module, these only declared once so only initialzed once maint_msgs = {}; local text_idx = (templates.langx == base_template) and 2 or 1; -- for {{langx}} 'text' positional parameter is '2' local translit_idx = (templates.langx == base_template) and 3 or 2; local xlate_idx = (templates.langx == base_template) and 4 or 3; if args[text_idx] and args.text then return make_error_msg ('conflicting: {{{' .. text_idx .. '}}} and |text=', args, template); else args.text = args[text_idx] or args.text; -- prefer positional 'text' parameter end msg = validate_text (template, args); -- ensure that |text= is set, does not contain italic markup and is protected from improper bolding if is_set (msg) then return msg; end args.text, tag = html_tag_select (args.text); -- inspects text; returns appropriate html tag with text trimmed accordingly if args[translit_idx] and args.translit then return make_error_msg ('conflicting: {{{'.. translit_idx .. '}}} and |translit=', args, template); else args.translit = args[translit_idx] or args.translit -- prefer positional 'translit' parameter end args.engvar = lang_data.engvar_sel_t[args.engvar] or 'us_t'; -- either 'gb_t' or 'us_t' when |engvar= valid; 'us_t' else if args[xlate_idx] and (args.translation or args.lit) then return make_error_msg ('conflicting: {{{'.. xlate_idx ..'}}} and |lit= or |translation=', args, template); elseif args.translation and args.lit then return make_error_msg ('conflicting: |lit= and |translation=', args, template); else args.translation = args[xlate_idx] or args.translation or args.lit; -- prefer positional 'translation' parameter end if args.links and args.link then return make_error_msg ('conflicting: |links= and |link=', args, template); else args.link = args.link or args.links; -- prefer args.link end validate_cat_args (args); -- determine if categorization should be suppressed args.rtl = args.rtl == 'yes'; -- convert to boolean: 'yes' -> true, other values -> false code, subtags.script, subtags.region, subtags.variant, subtags.private, msg = get_ietf_parts (args.code, args.script, args.region, args.variant); -- private omitted because private if msg then -- if an error detected then there is an error message return make_error_msg (msg, args, template); end local is_latn_text = unicode.is_Latin (args.text); -- make a boolean msg = text_script_match_test (subtags.script, is_latn_text) if msg then -- if an error detected then there is an error message return make_error_msg (msg, args, template); end args.italic, msg = validate_italic (args); if msg then return make_error_msg (msg, args, template); end if templates.langx == base_template then -- auto-italics for {{langx}} templates; adapted from {{lang}} (no support for poem tag) if nil == args.italic then -- nil when |italic= absent or not set or |italic=default; args.italic controls if ('latn' == subtags.script) or -- script is latn (this_wiki_lang_tag ~= code and not is_set (subtags.script) and is_latn_text) then -- text is not this wiki's language, no script specified and is wholly latn script (auto-italics) args.italic = 'italic'; -- set font-style:italic else args.italic = 'inherit'; -- italic not set; script not latn; inherit current style end end else -- {{lang-xx}} does not do auto italics; retained for those wikis that don't support {{langx}} if nil == args.italic then -- args.italic controls if is_set (subtags.script) then if 'latn' == subtags.script then args.italic = 'italic'; -- |script=Latn; set for font-style:italic else args.italic = initial_style_state; -- italic not set; script is not latn; set for font-style:<initial_style_state> end else args.italic = initial_style_state; -- here when |italic= and |script= not set; set for font-style:<initial_style_state> end end end if is_set (subtags.script) then -- if script set override rtl setting if in_array (subtags.script, lang_data.rtl_scripts) then args.rtl = true; -- script is an rtl script else args.rtl = false; -- script is not an rtl script end end args.proto, msg = validate_proto (args.proto); -- return boolean, or nil, or nil and error message flag if msg then return make_error_msg (table.concat ({'invalid |proto=: ', args.proto}), args, template); end args.code = format_ietf_tag (code, subtags.script, subtags.region, subtags.variant, subtags.private); -- format to recommended subtag styles language_name = language_name_get (args.code, code, true); -- get language name; try ietf tag first, then code w/o variant then code w/ variant category_name = language_name; -- category names retain IANA parenthetical diambiguators (if any) language_name = language_name:gsub ('%s+%b()', ''); -- remove IANA parenthetical disambiguators or qualifiers from names that have them if args.label then if 'none' ~= args.label then table.insert (out, table.concat ({args.label, ': '})); -- custom label end else if 'no' == args.link then table.insert (out, language_name); -- language name without wikilink else if mw.ustring.find (language_name, 'languages', 1, true) then table.insert (out, make_wikilink (language_name)); -- collective language name uses simple wikilink elseif lang_data.article_name[args.code:lower()] then -- is ietf tag in article name over ride? table.insert (out, make_wikilink (lang_data.article_name[args.code:lower()], language_name)); -- language name with wikilink from override data elseif lang_data.article_name[code] then -- is language tag in article override table.insert (out, make_wikilink (lang_data.article_name[code], language_name)); -- language name with wikilink from override data else table.insert (out, make_wikilink (language_name .. ' language', language_name)); -- language name with wikilink end end table.insert (out, ': '); -- separator end if 'invert' == args.italic then args.text = invert_italics (args.text) end args.text = proto_prefix (args.text, language_name, args.proto); -- prefix proto-language text with a splat table.insert (out, make_text_html (args.code, args.text, tag, args.rtl, args.italic, args.size, ('none' == args.label) and language_name or nil)) if is_set (args.translit) and not is_latn_text then -- transliteration; not supported when args.text is wholly latn text (this is an imperfect test) table.insert (out, ', '); -- comma to separate text from translit if 'none' ~= args.label then table.insert (out, '<small>'); if script_table[args['translit-script']] then -- when |translit-script= is set, try to use the script's name translit_script_name = script_table[args['translit-script']]; else translit_script_name = language_name; -- fall back on language name end translit_title = mw.title.makeTitle (0, table.concat ({'Romanization of ', translit_script_name})); -- make a title object; no engvar, article titles use US spelling if translit_title.exists and ('no' ~= args.link) then table.insert (out, make_wikilink ('Romanization of ' .. translit_script_name or language_name, substitute ('$1', {lang_data.engvar_t[args.engvar]['romanisz_pt']})) .. ':'); -- make a wikilink if there is an article to link to; engvar the display text else table.insert (out, substitute ('$1:', {lang_data.engvar_t[args.engvar]['romanisz_pt']})); -- else plain text per engvar end table.insert (out, '&nbsp;</small>'); -- close the small tag end translit = make_translit (args.code, language_name, args.translit, args['translit-std'], args['translit-script'], nil, args.engvar) if is_set (translit) then table.insert (out, translit); else return make_error_msg (table.concat ({'invalid translit-std: \'', args['translit-std'] or '[missing]'}), args, template); end end if is_set (args.translation) then -- translation (not supported in {{lang}}) table.insert (out, translation_make (args)); end table.insert (out, make_category (code, category_name, args.nocat)); table.insert (out, render_maint(args.nocat)); -- maintenance messages and categories return table.concat (out); -- put it all together and done end --[[--------------------------< L A N G _ X X _ A R G S _ G E T >---------------------------------------------- common function to get args table from {{lang-??}} templates returns table of args text positional parameters are not trimmed here but are selectively trimmed at html_tag_select() ]] local function lang_xx_args_get (frame, base_template) local args_t = getArgs(frame, { parentFirst= true, -- parameters in the template override parameters set in the {{#invoke:}} valueFunc = function (key, value) if ((templates.langx == base_template) and 2 or 1) == key then -- the 'text' positional parameter; 1 for {{lang-??}}, 2 for {{langx}}; do not trim wite space return value; -- return untrimmed 'text' positional parameter elseif value then -- all other values: if the value is not nil value = mw.text.trim (value); -- trim whitespace if '' ~= value then -- empty string when value was only whitespace return value; end end return nil; -- value was empty or contained only whitespace end -- end of valueFunc }); return args_t; end --[[--------------------------< L A N G _ X X _ I T A L I C >-------------------------------------------------- Entry point for those {{lang-??}} templates that call lang_xx_italic(). Sets the initial style state to italic. ]] local function lang_xx_italic (frame) local args = lang_xx_args_get (frame, templates.langxx); args.fn = nil; -- unset because not supported but this function might have been called by {{lang|fn=lang_xx_italic|...}} local msg = parameter_validate (args, templates.langxx); -- verify that all supplied parameters are supported by {{lang-??}} if msg then return make_error_msg (msg, args, templates.langxx); -- when template has unsupported params, abandon with error message end initial_style_state = 'italic'; return _lang_xx (args, templates.langxx) .. '[[Category:Pages using Lang-xx templates]]'; -- temporary category end --[[--------------------------< _ L A N G _ X X _ I T A L I C >------------------------------------------------ Entry point from another module. Sets the initial style state to italic. ]] local function _lang_xx_italic (args) initial_style_state = 'italic'; return _lang_xx (args, templates.langxx); end --[[--------------------------< L A N G _ X X _ I N H E R I T >------------------------------------------------ Entry point for those {{lang-??}} templates that call lang_xx_inherit(). Sets the initial style state to inherit. ]] local function lang_xx_inherit (frame) local args = lang_xx_args_get (frame, templates.langxx); args.fn = nil; -- unset because not supported but this function might have been called by {{lang|fn=lang_xx_inherit|...}} local msg = parameter_validate (args, templates.langxx); -- verify that all supplied parameters are supported by {{lang-??}} if msg then return make_error_msg (msg, args, templates.langxx); -- when template has unsupported params, abandon with error message end initial_style_state = 'inherit'; return _lang_xx (args, templates.langxx) .. '[[Category:Pages using Lang-xx templates]]'; -- temporary category end --[[--------------------------< _ L A N G _ X X _ I N H E R I T >---------------------------------------------- Entry point from another module. Sets the initial style state to inherit. ]] local function _lang_xx_inherit (args) initial_style_state = 'inherit'; return _lang_xx (args, templates.langxx); end --[[--------------------------< _ L A N G X >------------------------------------------------------------------ Entry point from another module. ]] local function _langx (args_t) local langx_data = mw.loadData ('Module:Lang/langx'); -- get necessary data local rtl_t = langx_data.rtl_t; -- get list of language tags for languages that are rendered right-to-left -- local script_t = langx_data.script_t; -- get list of language tags for {{lang-??}} templates that set |script=<something>; disabled because causes deprecated param message local link_t = langx_data.link_t; -- get list of language tags for {{lang-??}} templates that set |link=<something> local size_t = langx_data.size_t; -- get list of language tags for {{lang-??}} templates that set |size=<something> local msg = parameter_validate (args_t, templates.langx); if msg then return make_error_msg (msg, args_t, templates.langx); end args_t.code = args_t[1] or args_t.code; -- get the language tag; must be {{{1}}} or |code= if not args_t.code then return make_error_msg ('missing language tag', args_t, templates.langx); end args_t.rtl = args_t.rtl or (rtl_t[args_t.code] and 'yes'); -- prefer |rtl= in template call, use rtl_t else -- args_t.script = args_t.script or script_t[args_t.code]; -- prefer |script= in template call, use script_t else; disabled because causes deprecated param message args_t.link = args_t.link or link_t[args_t.code]; -- prefer |link= in template call, use link_t felse args_t.size = args_t.size or size_t[args_t.code]; -- prefer |size= in template call, use size_t else args_t[1] = nil; -- unset to mimic {{lang-??}} templates which set |code=xx local lang_subtag = args_t.code; -- use only the base language subtag for unsupported tag test; some args_t.code are modified by |script= etc return _lang_xx (args_t, templates.langx); end --[[--------------------------< L A N G X >-------------------------------------------------------------------- Entry point for {{langx}}. this function calls _lang_xx() to render non-English text. The {{lang-??}} templates have three positional paramters but {{langx}} has four: | 1 | 2 | 3 | 4 {{lang-xx |<text> |<transl> |<xlate> }} {{langx |<tag> |<text> |<transl> |<xlate> }} The calls to lang_xx_args_get() and _lang_xx() use 'Langx' as a flag for those functions to select the proper positional parameters. {{lang-??}} depends on the calling template to select 'inherit' or 'italic' to establish the default rendering. {{langx}} can't do that. The initial version of {{langx}} relied on a list of language tags (inherit_t in ~/langx) scraped from those {{lang-??}} templates that call lang_xx_inherit() to render text in upright font. Langx now uses auto-italics code adapted from {{lang}} (doesn't support poem tags) ]] local function langx (frame) local args_t = lang_xx_args_get (frame, templates.langx); -- get the arguments; 'Langx' is the <base_template> used to decide which positional param is 'text', 'translit', 'lit' return _langx (args_t); end --[[--------------------------< _ I S _ I E T F _ T A G >------------------------------------------------------ Returns true when a language name associated with IETF language tag exists; nil else. IETF language tag must be valid. All code combinations supported by {{lang}} and the {{lang-??}} templates are supported by this function. Module entry point from another module ]] local function _is_ietf_tag (tag) -- entry point when this module is require()d into another local c, s, r, v, p, err; -- code, script, region, variant, private, error message c, s, r, v, p, err = get_ietf_parts (tag); -- disassemble tag into constituent part and validate return ((c and not err) and true) or nil; -- return true when code portion has a value without error message; nil else end --[[--------------------------< I S _ I E T F _ T A G >-------------------------------------------------------- Module entry point from an {{#invoke:}} ]] local function is_ietf_tag (frame) return _is_ietf_tag (getArgs (frame)[1]); -- args[1] is the ietf language tag to be tested; also get parent frame end --[[--------------------------< I S _ I E T F _ T A G _ F R A M E >-------------------------------------------- Module entry point from an {{#invoke:}}; same as is_ietf_tag() except does not get parameters from the parent (template) frame. This function not useful when called by {{lang|fn=is_ietf_tag_frame|<tag>}} because <tag> is in the parent frame. ]] local function is_ietf_tag_frame (frame) return _is_ietf_tag (getArgs (frame, {frameOnly = true,})[1]); -- args[1] is the ietf language tag to be tested; do not get parent frame end --[[--------------------------< _ N A M E _ F R O M _ T A G >-------------------------------------------------- Returns language name associated with IETF language tag if valid; error message else. All code combinations supported by {{lang}} and the {{lang-??}} templates are supported by this function. Set invoke's |link= parameter to yes to get wikilinked version of the language name. Module entry point from another module ]] local function _name_from_tag (args) local subtags = {}; -- IETF subtags script, region, variant, and private local raw_code = args[1]; -- save a copy of the input IETF subtag local link = 'yes' == args['link']; -- make a boolean local label = args.label; local code; -- the language code local msg; -- gets an error message if IETF language tag is malformed or invalid local language_name = ''; code, subtags.script, subtags.region, subtags.variant, subtags.private, msg = get_ietf_parts (raw_code); if msg then local template = (args['template'] and table.concat ({'{{', args['template'], '}}: '})) or ''; -- make template name (if provided by the template) return table.concat ({'<span style=\"color:#d33\">Error: ', template, msg, '</span>'}); end raw_code = format_ietf_tag (code, subtags.script, subtags.region, subtags.variant, subtags.private); -- format to recommended subtag styles; private omitted because private language_name = language_name_get (raw_code, code); -- get language name; try ietf tag first, then code w/o variant then code w/ variant language_name = language_name:gsub ('%s+%b()', ''); -- remove IANA parenthetical disambiguators or qualifiers from names that have them if link then -- when |link=yes, wikilink the language name if mw.ustring.find (language_name, 'languages', 1, true) then language_name = make_wikilink (language_name, label); -- collective language name uses simple wikilink elseif lang_data.article_name[raw_code:lower()] then -- is ietf tag in article name override? language_name = make_wikilink (lang_data.article_name[raw_code:lower()], label or language_name); -- language name with wikilink from override data elseif lang_data.article_name[code] then -- is language tag in article name override? language_name = make_wikilink (lang_data.article_name[code], label or language_name); -- language name with wikilink from override data else language_name = make_wikilink (language_name .. ' language', label or language_name); -- language name with wikilink end end return language_name; end --[[--------------------------< N A M E _ F R O M _ T A G >---------------------------------------------------- Module entry point from an {{#invoke:}} ]] local function name_from_tag (frame) -- entry point from an {{#invoke:Lang|name_from_tag|<ietf tag>|link=<yes>|template=<template name>}} return _name_from_tag (getArgs(frame)) -- pass-on the args table, nothing else; getArgs() so we also get parent frame end --[[--------------------------< _ T A G _ F R O M _ N A M E >-------------------------------------------------- Returns the ietf language tag associated with the language name. Spelling of language name must be correct according to the spelling in the source tables. When a standard language name has a parenthetical disambiguator, that disambiguator must be omitted (they are not present in the data name-to-tag tables). Module entry point from another module ]] local function _tag_from_name (args) -- entry point from another module local msg; if args[1] and '' ~= args[1] then local data = mw.loadData ('Module:Lang/tag from name'); -- get the reversed data tables TODO: change when going live local lang = args[1]:lower(); -- allow any-case for the language name (speeling must till be correct) local tag = data.rev_override_table[lang] or data.rev_lang_table[lang] or data.rev_lang_dep_table[lang]; -- get the code; look first in the override then in the standard if tag then return tag, true; -- language name found so return tag and done; second return used by is_lang_name() else msg = 'language: ' .. args[1] .. ' not found' -- language name not found, error message end else msg = 'missing language name' -- language name not provided, error message end local template = ''; if args.template and '' ~= args.template then template = table.concat ({'{{', args['template'], '}}: '}); -- make template name (if provided by the template) end return table.concat ({'<span style=\"color:#d33\">Error: ', template, msg, '</span>'}); end --[[--------------------------< T A G _ F R O M _ N A M E >---------------------------------------------------- Module entry point from an {{#invoke:}} ]] local function tag_from_name (frame) -- entry point from an {{#invoke:Lang|tag_from_name|<language name>|link=<yes>|template=<template name>}} local result, _ = _tag_from_name (getArgs(frame)) -- pass-on the args table, nothing else; getArgs() so we also get parent frame; supress second return used by is_lang_name() return result; end --[[--------------------------< I S _ L A N G _ N A M E >------------------------------------------------------ Module entry point from an {{#invoke:}} ]] local function is_lang_name (frame) local _, result = _tag_from_name (getArgs(frame)) -- pass-on the args table, nothing else; getArgs() so we also get parent frame; supress second return used by tag_from_name() return result and true or nil; end --[[--------------------------< _ T R A N S L >---------------------------------------------------------------- Module entry point from another module ]] local function _transl (args) local title_table = lang_data.translit_title_table; -- table of transliteration standards and the language codes and scripts that apply to those standards local language_name; -- language name that matches language code; used for tool tip local translit; -- transliterated text to display local script; -- IANA script local msg; -- for when called functions return an error message maint_cats = {}; -- initialize because when this module required into another module, these only declared once so only initialzed once maint_msgs = {}; if is_set (args[3]) then -- [3] set when {{transliteration|code|standard|text}} args.text = args[3]; -- get the transliterated text args.translit_std = args[2] and args[2]:lower(); -- get the standard; lower case for table indexing if not title_table[args.translit_std] then return make_error_msg (table.concat ({'unrecognized transliteration standard: ', args.translit_std}), args, 'Transliteration'); end else if is_set (args[2]) then -- [2] set when {{transliteration|code|text}} args.text = args[2]; -- get the transliterated text else if args[1] and (args[1]:match ('^%a%a%a?%a?$') or -- args[2] missing; is args[1] a language or script tag or is it the transliterated text? args[1]:match ('^%a%a%a?%-x%-')) then -- or is args[1] a private-use tag return make_error_msg ('no text', args, 'Transliteration'); -- args[1] is a code so we're missing text else args.text = args[1]; -- args[1] is not a code so we're missing that; assign args.text for error message return make_error_msg ('missing language / script code', args, 'Transliteration'); end end end if is_set (args[1]) then -- IANA language code used for html lang= attribute; or ISO 15924 script code if args[1]:match ('^%a%a%a?%a?$') or args[1]:match ('^%a%a%a?%-x%-') then -- args[1] has correct form? args.code = args[1]:lower(); -- use the language/script code; only (2, 3, or 4 alpha characters) or private-use; lower case because table indexes are lower case else return make_error_msg (table.concat ({'unrecognized language / script code: ', args[1]}), args, 'Transliteration'); -- invalid language / script code end else return make_error_msg ('missing language / script code', args, 'Transliteration'); -- missing language / script code so quit end args.italic, msg = validate_italic (args); if msg then return make_error_msg (msg, args, 'Transliteration'); end if 'italic' == args.italic then -- 'italic' when |italic=yes; because that is same as absent or not set and |italic=default args.italic = nil; -- set to nil; end args.engvar = lang_data.engvar_sel_t[args.engvar] or 'us_t'; -- either 'gb_t' or 'us_t' when |engvar= valid; 'us_t' else if override_table[args.code] then -- is code a language code defined in the override table? language_name = override_table[args.code]; args.code = args.code:match ('^%a%a%a?'); -- if private use, strip all but language subtag elseif lang_table[args.code] then -- is code a language code defined in the standard language code tables? language_name = lang_table[args.code]; elseif lang_dep_table[args.code] then -- is code a language code defined in the deprecated language code tables? language_name = lang_dep_table[args.code]; elseif script_table[args.code] then -- if here, code is not a language code; is it a script code? language_name = script_table[args.code]; script = args.code; -- code was an ISO 15924 script so use that instead args.code = ''; -- unset because not a language code else return make_error_msg (table.concat ({'unrecognized language / script code: ', args.code}), args, 'Transliteration'); -- invalid language / script code end -- here only when all parameters passed to make_translit() are valid return make_translit (args.code, language_name, args.text, args.translit_std, script, args.italic, args.engvar); end --[[--------------------------< T R A N S L >------------------------------------------------------------------ Module entry point from an {{#invoke:}} ]] local function transl (frame) return _transl (getArgs(frame)); end --[[--------------------------< C A T E G O R Y _ F R O M _ T A G >-------------------------------------------- Returns category name associated with IETF language tag if valid; error message else All code combinations supported by {{lang}} and the {{lang-??}} templates are supported by this function. Module entry point from another module ]] local function _category_from_tag (args_t) local subtags = {}; -- IETF subtags script, region, variant, and private local raw_code = args_t[1]; -- save a copy of the input IETF subtag local link = 'yes' == args_t.link; -- make a boolean local label = args_t.label; local code; -- the language code local msg; -- gets an error message if IETF language tag is malformed or invalid local category_name = ''; code, subtags.script, subtags.region, subtags.variant, subtags.private, msg = get_ietf_parts (raw_code); if msg then local template = (args_t.template and table.concat ({'{{', args_t.template, '}}: '})) or ''; -- make template name (if provided by the template) return table.concat ({'<span style="color:#d33">Error: ', template, msg, '</span>'}); end raw_code = format_ietf_tag (code, subtags.script, subtags.region, subtags.variant, subtags.private); -- format to recommended subtag styles; private omitted because private category_name = language_name_get (raw_code, code); -- get language name; try ietf tag first, then code w/o variant then code w/ variant category_name = make_category (code, category_name, nil, true):gsub ('[%[%]]', ''); if link then return table.concat ({'[[:', category_name, ']]'}); else return category_name; end end --[[--------------------------< C A T E G O R Y _ F R O M _ T A G >-------------------------------------------- Module entry point from an {{#invoke:}} ]] local function category_from_tag (frame) -- entry point from an {{#invoke:Lang|category_from_tag|<ietf tag>|template=<template name>}} return _category_from_tag (getArgs (frame)); -- pass-on the args table, nothing else; getArgs() so we also get parent frame end --[[--------------------------< E X P O R T E D F U N C T I O N S >------------------------------------------ ]] return { category_from_tag = category_from_tag, lang = lang, -- entry point for {{lang}} langx = langx, -- entry point for {{langx}} lang_xx_inherit = lang_xx_inherit, -- entry points for {{lang-??}} lang_xx_italic = lang_xx_italic, is_ietf_tag = is_ietf_tag, is_ietf_tag_frame = is_ietf_tag_frame, is_lang_name = is_lang_name, tag_from_name = tag_from_name, -- returns ietf tag associated with language name name_from_tag = name_from_tag, -- used for template documentation; possible use in ISO 639 name from code templates transl = transl, -- entry point for {{transliteration}} _category_from_tag = _category_from_tag, -- entry points when this module is require()d into other modules _lang = _lang, _langx = _langx, _lang_xx_inherit = _lang_xx_inherit, _lang_xx_italic = _lang_xx_italic, _is_ietf_tag = _is_ietf_tag, get_ietf_parts = get_ietf_parts, _tag_from_name = _tag_from_name, _name_from_tag = _name_from_tag, _transl = _transl, _translation_make = translation_make, }; </textarea><div id="mw-scribunto-console"></div><div class="templatesUsed"><div class="mw-templatesUsedExplanation"><p><span id="templatesused">Pages transcluded onto the current version of this page<span class="posteditwindowhelplinks"> (<a href="/wiki/Help:Transclusion" title="Help:Transclusion">help</a>)</span>:</span> </p></div><ul> <li><a href="/wiki/Template:Category_link" title="Template:Category link">Template:Category link</a> (<a href="/w/index.php?title=Template:Category_link&action=edit" title="Template:Category link">view source</a>) (template editor protected)</li><li><a href="/wiki/Template:Category_link/core" title="Template:Category link/core">Template:Category link/core</a> (<a href="/w/index.php?title=Template:Category_link/core&action=edit" title="Template:Category link/core">view source</a>) (template editor protected)</li><li><a href="/wiki/Template:Category_link_with_count" title="Template:Category link with count">Template:Category link with count</a> (<a href="/w/index.php?title=Template:Category_link_with_count&action=edit" title="Template:Category link with count">view source</a>) (template editor protected)</li><li><a href="/wiki/Template:Cl" class="mw-redirect" title="Template:Cl">Template:Cl</a> (<a href="/w/index.php?title=Template:Cl&action=edit" class="mw-redirect" title="Template:Cl">view source</a>) (template editor protected)</li><li><a href="/wiki/Template:High-use" title="Template:High-use">Template:High-use</a> (<a href="/w/index.php?title=Template:High-use&action=edit" title="Template:High-use">view source</a>) (template editor protected)</li><li><a href="/wiki/Template:Hlist/styles.css" title="Template:Hlist/styles.css">Template:Hlist/styles.css</a> (<a href="/w/index.php?title=Template:Hlist/styles.css&action=edit" title="Template:Hlist/styles.css">view source</a>) (protected)</li><li><a href="/wiki/Template:Language_templates" title="Template:Language templates">Template:Language templates</a> (<a href="/w/index.php?title=Template:Language_templates&action=edit" title="Template:Language templates">edit</a>) </li><li><a href="/wiki/Template:Language_templates/styles.css" title="Template:Language templates/styles.css">Template:Language templates/styles.css</a> (<a href="/w/index.php?title=Template:Language_templates/styles.css&action=edit" title="Template:Language templates/styles.css">edit</a>) </li><li><a href="/wiki/Template:Lua" title="Template:Lua">Template:Lua</a> (<a href="/w/index.php?title=Template:Lua&action=edit" title="Template:Lua">view source</a>) (template editor protected)</li><li><a href="/wiki/Template:Nowrap" title="Template:Nowrap">Template:Nowrap</a> (<a href="/w/index.php?title=Template:Nowrap&action=edit" title="Template:Nowrap">view source</a>) (protected)</li><li><a href="/wiki/Template:Plainlist/styles.css" title="Template:Plainlist/styles.css">Template:Plainlist/styles.css</a> (<a href="/w/index.php?title=Template:Plainlist/styles.css&action=edit" title="Template:Plainlist/styles.css">view source</a>) (protected)</li><li><a href="/wiki/Template:Section_link" title="Template:Section link">Template:Section link</a> (<a href="/w/index.php?title=Template:Section_link&action=edit" title="Template:Section link">view source</a>) (template editor protected)</li><li><a href="/wiki/Template:Sidebar" title="Template:Sidebar">Template:Sidebar</a> (<a href="/w/index.php?title=Template:Sidebar&action=edit" title="Template:Sidebar">view source</a>) (template editor protected)</li><li><a href="/wiki/Template:Template_link" title="Template:Template link">Template:Template link</a> (<a href="/w/index.php?title=Template:Template_link&action=edit" title="Template:Template link">view source</a>) (protected)</li><li><a href="/wiki/Template:Template_link_code" title="Template:Template link code">Template:Template link code</a> (<a href="/w/index.php?title=Template:Template_link_code&action=edit" title="Template:Template link code">view source</a>) (template editor protected)</li><li><a href="/wiki/Template:Template_link_expanded" title="Template:Template link expanded">Template:Template link expanded</a> (<a href="/w/index.php?title=Template:Template_link_expanded&action=edit" title="Template:Template link expanded">view source</a>) (protected)</li><li><a href="/wiki/Template:Tl" class="mw-redirect" title="Template:Tl">Template:Tl</a> (<a href="/w/index.php?title=Template:Tl&action=edit" class="mw-redirect" title="Template:Tl">view source</a>) (protected)</li><li><a href="/wiki/Template:Tld" class="mw-redirect" title="Template:Tld">Template:Tld</a> (<a href="/w/index.php?title=Template:Tld&action=edit" class="mw-redirect" title="Template:Tld">view source</a>) (template editor protected)</li><li><a href="/wiki/Template:Tlx" class="mw-redirect" title="Template:Tlx">Template:Tlx</a> (<a href="/w/index.php?title=Template:Tlx&action=edit" class="mw-redirect" title="Template:Tlx">view source</a>) (protected)</li><li><a href="/wiki/Template:Yesno" title="Template:Yesno">Template:Yesno</a> (<a href="/w/index.php?title=Template:Yesno&action=edit" title="Template:Yesno">view source</a>) (protected)</li><li><a href="/wiki/Module:Arguments" title="Module:Arguments">Module:Arguments</a> (<a href="/w/index.php?title=Module:Arguments&action=edit" title="Module:Arguments">view source</a>) (protected)</li><li><a href="/wiki/Module:Documentation" title="Module:Documentation">Module:Documentation</a> (<a href="/w/index.php?title=Module:Documentation&action=edit" title="Module:Documentation">view source</a>) (template editor protected)</li><li><a href="/wiki/Module:Documentation/config" title="Module:Documentation/config">Module:Documentation/config</a> (<a href="/w/index.php?title=Module:Documentation/config&action=edit" title="Module:Documentation/config">view source</a>) (template editor protected)</li><li><a href="/wiki/Module:Documentation/styles.css" title="Module:Documentation/styles.css">Module:Documentation/styles.css</a> (<a href="/w/index.php?title=Module:Documentation/styles.css&action=edit" title="Module:Documentation/styles.css">view source</a>) (template editor protected)</li><li><a href="/wiki/Module:Effective_protection_expiry" title="Module:Effective protection expiry">Module:Effective protection expiry</a> (<a href="/w/index.php?title=Module:Effective_protection_expiry&action=edit" title="Module:Effective protection expiry">view source</a>) (protected)</li><li><a href="/wiki/Module:Effective_protection_level" title="Module:Effective protection level">Module:Effective protection level</a> (<a href="/w/index.php?title=Module:Effective_protection_level&action=edit" title="Module:Effective protection level">view source</a>) (protected)</li><li><a href="/wiki/Module:File_link" title="Module:File link">Module:File link</a> (<a href="/w/index.php?title=Module:File_link&action=edit" title="Module:File link">view source</a>) (template editor protected)</li><li><a href="/wiki/Module:High-use" title="Module:High-use">Module:High-use</a> (<a href="/w/index.php?title=Module:High-use&action=edit" title="Module:High-use">view source</a>) (template editor protected)</li><li><a href="/wiki/Module:Lang" title="Module:Lang">Module:Lang</a> (<a href="/w/index.php?title=Module:Lang&action=edit" title="Module:Lang">view source</a>) (template editor protected)</li><li><a href="/wiki/Module:Lang/ISO_639_synonyms" title="Module:Lang/ISO 639 synonyms">Module:Lang/ISO 639 synonyms</a> (<a href="/w/index.php?title=Module:Lang/ISO_639_synonyms&action=edit" title="Module:Lang/ISO 639 synonyms">view source</a>) (template editor protected)</li><li><a href="/wiki/Module:Lang/data" title="Module:Lang/data">Module:Lang/data</a> (<a href="/w/index.php?title=Module:Lang/data&action=edit" title="Module:Lang/data">view source</a>) (template editor protected)</li><li><a href="/wiki/Module:Lang/data/iana_languages" title="Module:Lang/data/iana languages">Module:Lang/data/iana languages</a> (<a href="/w/index.php?title=Module:Lang/data/iana_languages&action=edit" title="Module:Lang/data/iana languages">view source</a>) (template editor protected)</li><li><a href="/wiki/Module:Lang/data/iana_regions" title="Module:Lang/data/iana regions">Module:Lang/data/iana regions</a> (<a href="/w/index.php?title=Module:Lang/data/iana_regions&action=edit" title="Module:Lang/data/iana regions">view source</a>) (template editor protected)</li><li><a href="/wiki/Module:Lang/data/iana_scripts" title="Module:Lang/data/iana scripts">Module:Lang/data/iana scripts</a> (<a href="/w/index.php?title=Module:Lang/data/iana_scripts&action=edit" title="Module:Lang/data/iana scripts">view source</a>) (template editor protected)</li><li><a href="/wiki/Module:Lang/data/iana_suppressed_scripts" title="Module:Lang/data/iana suppressed scripts">Module:Lang/data/iana suppressed scripts</a> (<a href="/w/index.php?title=Module:Lang/data/iana_suppressed_scripts&action=edit" title="Module:Lang/data/iana suppressed scripts">view source</a>) (template editor protected)</li><li><a href="/wiki/Module:Lang/data/iana_variants" title="Module:Lang/data/iana variants">Module:Lang/data/iana variants</a> (<a href="/w/index.php?title=Module:Lang/data/iana_variants&action=edit" title="Module:Lang/data/iana variants">view source</a>) (template editor protected)</li><li><a href="/wiki/Module:Lang/doc" title="Module:Lang/doc">Module:Lang/doc</a> (<a href="/w/index.php?title=Module:Lang/doc&action=edit" title="Module:Lang/doc">edit</a>) </li><li><a href="/wiki/Module:List" title="Module:List">Module:List</a> (<a href="/w/index.php?title=Module:List&action=edit" title="Module:List">view source</a>) (protected)</li><li><a href="/wiki/Module:Lua_banner" title="Module:Lua banner">Module:Lua banner</a> (<a href="/w/index.php?title=Module:Lua_banner&action=edit" title="Module:Lua banner">view source</a>) (template editor protected)</li><li><a href="/wiki/Module:Message_box" title="Module:Message box">Module:Message box</a> (<a href="/w/index.php?title=Module:Message_box&action=edit" title="Module:Message box">view source</a>) (protected)</li><li><a href="/wiki/Module:Message_box/configuration" title="Module:Message box/configuration">Module:Message box/configuration</a> (<a href="/w/index.php?title=Module:Message_box/configuration&action=edit" title="Module:Message box/configuration">view source</a>) (protected)</li><li><a href="/wiki/Module:Message_box/ombox.css" title="Module:Message box/ombox.css">Module:Message box/ombox.css</a> (<a href="/w/index.php?title=Module:Message_box/ombox.css&action=edit" title="Module:Message box/ombox.css">view source</a>) (protected)</li><li><a href="/wiki/Module:Navbar" title="Module:Navbar">Module:Navbar</a> (<a href="/w/index.php?title=Module:Navbar&action=edit" title="Module:Navbar">view source</a>) (protected)</li><li><a href="/wiki/Module:Navbar/configuration" title="Module:Navbar/configuration">Module:Navbar/configuration</a> (<a href="/w/index.php?title=Module:Navbar/configuration&action=edit" title="Module:Navbar/configuration">view source</a>) (protected)</li><li><a href="/wiki/Module:Navbar/styles.css" title="Module:Navbar/styles.css">Module:Navbar/styles.css</a> (<a href="/w/index.php?title=Module:Navbar/styles.css&action=edit" title="Module:Navbar/styles.css">view source</a>) (protected)</li><li><a href="/wiki/Module:Protection_banner" title="Module:Protection banner">Module:Protection banner</a> (<a href="/w/index.php?title=Module:Protection_banner&action=edit" title="Module:Protection banner">view source</a>) (template editor protected)</li><li><a href="/wiki/Module:Protection_banner/config" title="Module:Protection banner/config">Module:Protection banner/config</a> (<a href="/w/index.php?title=Module:Protection_banner/config&action=edit" title="Module:Protection banner/config">view source</a>) (template editor protected)</li><li><a href="/wiki/Module:Section_link" title="Module:Section link">Module:Section link</a> (<a href="/w/index.php?title=Module:Section_link&action=edit" title="Module:Section link">view source</a>) (template editor protected)</li><li><a href="/wiki/Module:Sidebar" title="Module:Sidebar">Module:Sidebar</a> (<a href="/w/index.php?title=Module:Sidebar&action=edit" title="Module:Sidebar">view source</a>) (template editor protected)</li><li><a href="/wiki/Module:Sidebar/configuration" title="Module:Sidebar/configuration">Module:Sidebar/configuration</a> (<a href="/w/index.php?title=Module:Sidebar/configuration&action=edit" title="Module:Sidebar/configuration">view source</a>) (template editor protected)</li><li><a href="/wiki/Module:Sidebar/styles.css" title="Module:Sidebar/styles.css">Module:Sidebar/styles.css</a> (<a href="/w/index.php?title=Module:Sidebar/styles.css&action=edit" title="Module:Sidebar/styles.css">view source</a>) (template editor protected)</li><li><a href="/wiki/Module:String" title="Module:String">Module:String</a> (<a href="/w/index.php?title=Module:String&action=edit" title="Module:String">view source</a>) (protected)</li><li><a href="/wiki/Module:TableTools" title="Module:TableTools">Module:TableTools</a> (<a href="/w/index.php?title=Module:TableTools&action=edit" title="Module:TableTools">view source</a>) (protected)</li><li><a href="/wiki/Module:Template_link_general" title="Module:Template link general">Module:Template link general</a> (<a href="/w/index.php?title=Module:Template_link_general&action=edit" title="Module:Template link general">view source</a>) (protected)</li><li><a href="/wiki/Module:Transclusion_count" title="Module:Transclusion count">Module:Transclusion count</a> (<a href="/w/index.php?title=Module:Transclusion_count&action=edit" title="Module:Transclusion count">view source</a>) (template editor protected)</li><li><a href="/wiki/Module:Transclusion_count/data/L" title="Module:Transclusion count/data/L">Module:Transclusion count/data/L</a> (<a href="/w/index.php?title=Module:Transclusion_count/data/L&action=edit" title="Module:Transclusion count/data/L">view source</a>) (extended confirmed protected)</li><li><a href="/wiki/Module:Unicode_data" title="Module:Unicode data">Module:Unicode data</a> (<a href="/w/index.php?title=Module:Unicode_data&action=edit" title="Module:Unicode data">view source</a>) (template editor protected)</li><li><a href="/wiki/Module:Yesno" title="Module:Yesno">Module:Yesno</a> (<a href="/w/index.php?title=Module:Yesno&action=edit" title="Module:Yesno">view source</a>) (protected)</li></ul></div><p id="mw-returnto">Return to <a href="/wiki/Module:Lang" title="Module:Lang">Module:Lang</a>.</p> <!--esi <esi:include src="/esitest-fa8a495983347898/content" /> --><noscript><img src="https://login.m.wikimedia.org/wiki/Special:CentralAutoLogin/start?type=1x1&mobile=1" alt="" width="1" height="1" style="border: none; position: absolute;"></noscript> <div class="printfooter" data-nosnippet="">Retrieved from "<a dir="ltr" href="https://en.wikipedia.org/wiki/Module:Lang">https://en.wikipedia.org/wiki/Module:Lang</a>"</div></div> </div> <div class="post-content" id="page-secondary-actions"> </div> </main> <footer class="mw-footer minerva-footer" role="contentinfo"> <div class="post-content footer-content"> <div id="p-lang"> <h4>Languages</h4> <section> <ul id="p-variants" class="minerva-languages"></ul> <ul class="minerva-languages"></ul> <p>This page is not available in other languages.</p> </section> </div> <div class="minerva-footer-logo"><img src="/static/images/mobile/copyright/wikipedia-wordmark-en.svg" alt="Wikipedia" width="120" height="18" style="width: 7.5em; height: 1.125em;"/> </div> <ul id="footer-info" class="footer-info hlist hlist-separated"> </ul> <ul id="footer-places" class="footer-places hlist hlist-separated"> <li id="footer-places-privacy"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Privacy_policy">Privacy policy</a></li> <li id="footer-places-about"><a href="/wiki/Wikipedia:About">About Wikipedia</a></li> <li id="footer-places-disclaimers"><a href="/wiki/Wikipedia:General_disclaimer">Disclaimers</a></li> <li id="footer-places-contact"><a href="//en.wikipedia.org/wiki/Wikipedia:Contact_us">Contact Wikipedia</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/#/en.wikipedia.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-terms-use"><a href="https://foundation.m.wikimedia.org/wiki/Special:MyLanguage/Policy:Terms_of_Use">Terms of Use</a></li> <li id="footer-places-desktop-toggle"><a id="mw-mf-display-toggle" href="//en.wikipedia.org/w/index.php?title=Module:Lang&action=edit&mobileaction=toggle_view_desktop" data-event-name="switch_to_desktop">Desktop</a></li> </ul> </div> </footer> </div> </div> <div class="mw-notification-area" data-mw="interface"></div> <!-- v:8.3.1 --> <script>(RLQ=window.RLQ||[]).push(function(){mw.log.warn("This page is using the deprecated ResourceLoader module \"mediawiki.ui.button\".\n[1.41] Please use Codex. See migration guidelines: https://www.mediawiki.org/wiki/Codex/Migrating_from_MediaWiki_UI");mw.config.set({"wgHostname":"mw-web.codfw.main-f69cdc8f6-dj6bk","wgBackendResponseTime":446,"wgPageParseReport":{"limitreport":{"cputime":"0.146","walltime":"0.207","ppvisitednodes":{"value":659,"limit":1000000},"postexpandincludesize":{"value":44474,"limit":2097152},"templateargumentsize":{"value":8145,"limit":2097152},"expansiondepth":{"value":18,"limit":100},"expensivefunctioncount":{"value":7,"limit":500},"unstrip-depth":{"value":0,"limit":20},"unstrip-size":{"value":3557,"limit":5000000},"entityaccesscount":{"value":0,"limit":400},"timingprofile":["100.00% 170.457 1 -total"," 65.46% 111.573 1 Template:Protected_page_text/cascade"," 63.80% 108.756 1 Template:Protected_page_text"," 58.81% 100.251 1 Template:Fmbox"," 27.55% 46.967 1 Template:Submit_an_edit_request"," 24.24% 41.326 2 Template:Blocked_text"," 11.33% 19.309 1 Template:Colocationwebhost"," 10.36% 17.659 1 Template:Mbox"," 10.09% 17.197 1 Template:Editnotice_load"," 10.01% 17.069 1 Template:Hidden"]},"scribunto":{"limitreport-timeusage":{"value":"0.067","limit":"10.000"},"limitreport-memusage":{"value":1578988,"limit":52428800}},"cachereport":{"origin":"mw-web.codfw.main-f69cdc8f6-dj6bk","timestamp":"20241124185822","ttl":2592000,"transientcontent":false}}});});</script> <script>(window.NORLQ=window.NORLQ||[]).push(function(){var ns,i,p,img;ns=document.getElementsByTagName('noscript');for(i=0;i<ns.length;i++){p=ns[i].nextSibling;if(p&&p.className&&p.className.indexOf('lazy-image-placeholder')>-1){img=document.createElement('img');img.setAttribute('src',p.getAttribute('data-src'));img.setAttribute('width',p.getAttribute('data-width'));img.setAttribute('height',p.getAttribute('data-height'));img.setAttribute('alt',p.getAttribute('data-alt'));p.parentNode.replaceChild(img,p);}}});</script> </body> </html>