Template:SPARQL2
<mediawiki xmlns="http://www.mediawiki.org/xml/export-0.11/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.11/ http://www.mediawiki.org/xml/export-0.11.xsd" version="0.11" xml:lang="en">
<siteinfo> <sitename>Wikidata</sitename> <dbname>wikidatawiki</dbname> <base>https://www.wikidata.org/wiki/Wikidata:Main_Page</base> <generator>MediaWiki 1.47.0-wmf.17</generator> <case>first-letter</case> <namespaces> <namespace key="-2" case="first-letter">Media</namespace> <namespace key="-1" case="first-letter">Special</namespace> <namespace key="0" case="first-letter" /> <namespace key="1" case="first-letter">Talk</namespace> <namespace key="2" case="first-letter">User</namespace> <namespace key="3" case="first-letter">User talk</namespace> <namespace key="4" case="first-letter">Wikidata</namespace> <namespace key="5" case="first-letter">Wikidata talk</namespace> <namespace key="6" case="first-letter">File</namespace> <namespace key="7" case="first-letter">File talk</namespace> <namespace key="8" case="first-letter">MediaWiki</namespace> <namespace key="9" case="first-letter">MediaWiki talk</namespace> <namespace key="10" case="first-letter">Template</namespace> <namespace key="11" case="first-letter">Template talk</namespace> <namespace key="12" case="first-letter">Help</namespace> <namespace key="13" case="first-letter">Help talk</namespace> <namespace key="14" case="first-letter">Category</namespace> <namespace key="15" case="first-letter">Category talk</namespace> <namespace key="120" case="first-letter">Property</namespace> <namespace key="121" case="first-letter">Property talk</namespace> <namespace key="122" case="first-letter">Query</namespace> <namespace key="123" case="first-letter">Query talk</namespace> <namespace key="146" case="first-letter">Lexeme</namespace> <namespace key="147" case="first-letter">Lexeme talk</namespace> <namespace key="640" case="first-letter">EntitySchema</namespace> <namespace key="641" case="first-letter">EntitySchema talk</namespace> <namespace key="710" case="first-letter">TimedText</namespace> <namespace key="711" case="first-letter">TimedText talk</namespace> <namespace key="828" case="first-letter">Module</namespace> <namespace key="829" case="first-letter">Module talk</namespace> <namespace key="1198" case="first-letter">Translations</namespace> <namespace key="1199" case="first-letter">Translations talk</namespace> <namespace key="1728" case="first-letter">Event</namespace> <namespace key="1729" case="first-letter">Event talk</namespace> <namespace key="2600" case="first-letter">Topic</namespace> </namespaces> </siteinfo> <page> <title>Template:SPARQL2</title> <ns>10</ns> <id>28161690</id> <revision> <id>2346047691</id> <parentid>2346040648</parentid> <timestamp>2025-05-08T12:02:25Z</timestamp> <contributor> <username>Madamebiblio</username> <id>2952832</id> </contributor> <minor/> <comment>Reverted edits by 201.143.205.181 (talk) to last revision by Kokage si</comment> <origin>2294596805</origin> <model>wikitext</model> <format>text/x-wiki</format> <text bytes="7567" sha1="s4975lvx7s2i4pjji1govtxccu2rt3e" xml:space="preserve">Template:SPARQL2/doc
<onlyinclude>Template:Clear{{#ifeq:|{{{nohints}}}| <!--hidden hints--> | {{TranslateThis<!--
-->|ar=يستخدم الاستعلام التالي هذه:<!--
-->|be-tarask=Дадзены запыт выкарыстоўвае:<!--
-->|cs=Následující dotaz používá:<!--
-->|de=Die Suchanfrage verwendet:<!--
-->|en=The following query uses these:<!--
-->|en-gb=The following query uses these:<!--
-->|el=Το ακόλουθο ερώτημα χρησιμοποιεί αυτά:<!--
-->|es=La siguiente consulta utiliza lo siguiente:<!--
-->|fi=Seuraava kysely käyttää näitä:<!--
-->|fr=La requête suivante utilise ces :<!--
-->|hu=Ez a lekérdezés a következőket használja:<!--
-->|id=Kueri di bawah akan menggunakan entitas berikut:<!--
-->|it=La seguente query utilizza questi:<!--
-->|ja=以下のクエリではこれらを使用します:<!--
-->|nl=Deze query gebruikt:<!--
-->|pl=To zapytanie używa:<!--
-->|pt=A consulta seguinte utiliza estes:<!--
-->|pt-br=A consulta seguinte utiliza estes:<!--
-->|ru=Этот запрос использует:<!--
-->|sv=Följande fråga använder dessa:<!--
-->|tr=Aşağıdaki sorgu bunları kullanıyor:<!--
-->|uk=Цей запит використовує:<!--
-->}}<!-- -->Template:ItemOrNot <!-- -->Template:ItemOrNot <!-- -->Template:ItemOrNot <!--
-->}}
[[:Template:SPARQLText]]
<!-- --><div class="displayonly">{{#if: ||Template:Int try it}}</div>Template:Clear</onlyinclude><noinclude> <templatedata> { "params": { "query": { "required": true, "label": { "ar": "استعلام", "be-tarask": "запыт", "cs": "dotaz", "en": "query", "es": "consulta", "fr": "requête", "id": "kueri", "it": "query", "ja": "クエリ", "pl": "zapytanie", "pt": "consulta", "pt-br": "consulta", "sv": "fråga",
"tr": "sorgu",
"uk": "запит" }, "description": { "ar": "استعلام سباركل", "be-tarask": "запыт SPARQL", "cs": "SPARQL dotaz", "en": "SPARQL query", "es": "consulta SPARQL", "fr": "la requête que le modèle doit traiter et afficher", "id": "kueri SPARQL", "it": "query SPARQL", "ja": "SPARQLクエリ", "pl": "query SPARQL", "pt": "consulta SPARQL", "pt-br": "consulta SPARQL", "sv": "SPARQL fråga", "tr": "SPARQL sorgusu", "uk": "запит SPARQL" }, "example": { "be-tarask": "SELECT * WHERE { ?x wdt:P31 wd:Q5 } LIMIT 1", "cs": "SELECT * WHERE { ?x wdt:P31 wd:Q5 } LIMIT 1", "en": "SELECT * WHERE { ?x wdt:P31 wd:Q5 } LIMIT 1", "es": "SELECT ?item WHERE { ?item wdt:P31 wd:Q5 } LIMIT 1", "fr": "select ?item where { ?item wdt:P31 wd:Q5 } LIMIT 1", "id": "SELECT * WHERE { ?a wdt:P31 wd:Q5 } LIMIT 1", "it": "select ?item where { ?item wdt:P31 wd:Q5 } LIMIT 1", "pt": "select ?item where { ?item wdt:P31 wd:Q5 } LIMIT 1", "pt-br": "select ?item where { ?item wdt:P31 wd:Q5 } LIMIT 1" }, "type": "string", "aliases": [ "sparql" ], "suggested": true }, "extraprefix": { "description": { "ar": "بادئات إضافية لإضافتها",
"be-tarask": "дадатковыя прэфіксы (неабавязковыя)",
"cs": "Dodatečné prefixy (volitelné)", "en": "Extra prefixes to be added", "es": "Prefijos extra a añadir (opcional)", "fr": "les préfixes SPARQL non standards ou inconnus du service de requête éventuellement nécessaires (optionnel)", "id": "Prefiks SPARQL yang akan ditambahkan", "it": "Aggiungere i prefissi SPARQL non standard o sconosciuti eventualmente necessari (opzionale)", "ja": "追加する接頭辞(オプション)", "pl": "Dodatkowe prefiksy (opcjonalnie)", "pt": "Adicionar os prefixos SPARQL não padrões ou desconhecidos eventualmente necessários (opcional)", "pt-br": "Adicionar os prefixos SPARQL não padrões ou desconhecidos eventualmente necessários (opcional)", "uk": "Додаткові префікси (необов'язкові)" }, "example": "PREFIX wikibase: <http://wikiba.se/ontology#>", "type": "string" } }, "description": {
"be-tarask": "Гэты шаблён выводзіць запыт SPARQL з падсьветкай сынтаксісу, выкарыстаных элемэнтаў і спасылак на WDQS дзеля запуску запыту. \nЗРАБІЦЬ: скарыстаныя меткі элемэнтаў не лякалізаваныя",
"cs": "Tato šablona zobrazuje SPARQL dotaz ze zvýrazněnou syntaxí, použité položky a odkaz na WDQS dotazovací službu pro vyzkoušení.", "en": "This template displays SPARQL query with syntax highlighting, used items and link to WDQS query site to run the query. \nTODO: used items labels are not localized", "es": "Esta plantilla muestra una consulta SPARQL con resaltado de sintaxis, los items utilizados y un enlace al WDQS para lanzar la consulta", "fr": "Ce modèle affiche une requête SPARQL et permet de la lancer au travers du service de requête Wikidata. Il affiche aussi quelques informations basiques sur les éléments et fonctionnalités utilisées par cette requête", "id": "Templat ini menampilkan kueri SPARQL dengan pembedaan warna pada sintaks beserta entitas Wikidata yang digunakan dan pranala kueri di WDQS.", "it": "Questo template mostra una query SPARQL evidenziandone la sintassi e gli elementi usati e fornisce un link alla query WDQS site che permette di lanciare la query", "ja": "このテンプレートは構文強調付きのSPARQLクエリ、使用した項目、クエリを実行するWDQSクエリサイトへのリンクを表示します。", "pl": "Szablon wyświetla zapytanie SPARQL z podświetlaniem składni, listą użytych elementów i linkiem do WDQS.", "pt": "Esta predefinição mostra uma consulta SPARQL na qual evidencia a sintaxe e os elementos usados e fornece um enlace ao site WDQS que permite executar a consulta", "pt-br": "Esta predefinição mostra uma consulta SPARQL na qual evidencia a sintaxe e os elementos usados e fornece um enlace ao site WDQS que permite executar a consulta", "sv": "Denna mall visar en SPARQL fråga med syntaxfärgning, använda objekt och länk till WDQS frågesajten för att köra frågan. \nTODO: använda objekts etiketter är inte lokaliserade", "uk": "Цей шаблон показує запит SPARQL з підсвічуванням елементів синтаксису, список використаних елементів і посилання на сайт WDQS-запиту." }, "paramOrder": [ "query", "extraprefix" ], "format": "block" } </templatedata> </noinclude></text>
<sha1>s4975lvx7s2i4pjji1govtxccu2rt3e</sha1>
</revision>
</page>
<page>
<title>Template:Template</title>
<ns>10</ns>
<id>12414</id>
<redirect title="Template:Tl" />
<revision>
<id>431881</id>
<parentid>312894</parentid>
<timestamp>2012-11-13T02:07:50Z</timestamp>
<contributor>
<username>~riley</username>
<id>2219</id>
</contributor>
<comment>http://en.wikipedia.org/w/index.php?title=Template:Template&action=edit</comment>
<origin>431881</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="25" sha1="cdpzj9yp99pn5v093b404f4sc7cybv1" xml:space="preserve">#REDIRECT Template:Tl</text>
<sha1>cdpzj9yp99pn5v093b404f4sc7cybv1</sha1>
</revision>
</page>
<page>
<title>Template:Tl</title>
<ns>10</ns>
<id>3170</id>
<revision>
<id>2508986920</id>
<parentid>1946850712</parentid>
<timestamp>2026-06-22T01:25:21Z</timestamp>
<contributor>
<username>RogueScholar</username>
<id>3003918</id>
</contributor>
<minor/>
<comment>Format template code for readability and convert numeric HTML entities to named equivalents to accomplish the same</comment>
<origin>2508986920</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="1299" sha1="dqel96mgakegupz568kpnt91rdib9m4" xml:space="preserve"><includeonly><code>{{{{#if:|subst:}}<!-- Begin evaluation of first parameter.
-->{{#ifeq:{|:|:[[]]|<!-- If already prefixed by colon, show the link as such, too.
-->{{#switch:<!-- Target's namespace determines the link format. -->
| | Template = [[Template:|]]<!-- Main: (absent) or Template: namespaces -->
| File | Category = [[:{{{1}}}]]<!-- File and Category namespaces receive hidden colon prefix. -->
| #default = [[{{{1}}}]]<!-- All others are linked verbatim.
-->}}<!-- End of switch function. -->}}<!-- End of first parameter evaluation.
-->{{#ifeq: {{{2}}}| x||{{{2}}}}}<!--
-->{{#ifeq: {{{3}}}| x||{{{3}}}}}<!--
-->{{#ifeq: {{{4}}}| x||{{{4}}}}}<!--
-->{{#ifeq: {{{5}}}| x||{{{5}}}}}<!--
-->{{#ifeq: {{{6}}}| x||{{{6}}}}}<!--
-->{{#ifeq: {{{7}}}| x||{{{7}}}}}<!--
-->{{#ifeq: {{{8}}}| x||{{{8}}}}}<!--
-->{{#ifeq: {{{9}}}| x||{{{9}}}}}<!--
-->{{#ifeq:{{{10}}}|x||{{{10}}}}}}}</code></includeonly><noinclude>
Template:Documentation</noinclude></text>
<sha1>dqel96mgakegupz568kpnt91rdib9m4</sha1>
</revision>
</page>
<page>
<title>Template:Capitalize</title>
<ns>10</ns>
<id>24835143</id>
<revision>
<id>2283223741</id>
<parentid>2282968755</parentid>
<timestamp>2024-12-03T22:55:49Z</timestamp>
<contributor>
<username>Tacsipacsi</username>
<id>33956</id>
</contributor>
<comment>Undid revision 2282968755 by 2806:2F0:A080:F124:78E9:9300:6983:EA83 (talk): ???</comment>
<origin>2283223741</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="100" sha1="08bgnnmlolmwjwag381zkq615fl2s0a" xml:space="preserve"><includeonly>Script error: No such module "Capitalize".</includeonly><noinclude>
Template:Doc </noinclude></text>
<sha1>08bgnnmlolmwjwag381zkq615fl2s0a</sha1>
</revision>
</page>
<page>
<title>Template:Int items</title>
<ns>10</ns>
<id>28641837</id>
<revision>
<id>2438810545</id>
<parentid>2208740771</parentid>
<timestamp>2025-12-06T14:15:50Z</timestamp>
<contributor>
<username>YeBoy371</username>
<id>2200680</id>
</contributor>
<origin>2438810545</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="475" sha1="knyh87z85w0os01yxpmvrzvlnwf07fb" xml:space="preserve"><noinclude>Template:Doc</noinclude>Template:TranslateThis</text>
<sha1>knyh87z85w0os01yxpmvrzvlnwf07fb</sha1>
</revision>
</page>
<page>
<title>Module:Capitalize</title>
<ns>828</ns>
<id>25940912</id>
<revision>
<id>333880118</id>
<parentid>327538585</parentid>
<timestamp>2016-05-08T21:08:10Z</timestamp>
<contributor>
<username>TomT0m</username>
<id>7333</id>
</contributor>
<comment>cap after the tags</comment>
<origin>333880118</origin>
<model>Scribunto</model>
<format>text/plain</format>
<text bytes="518" sha1="oi3oo9q42s5okxrm5hbfy01zk32pehp" xml:space="preserve">
local p = {}
function p.cap(str) lang = mw.getContentLanguage() if lang:ucfirst(str) ~= str then return lang:ucfirst(str) else local substr = mw.ustring.sub b, e = mw.ustring.find(str, ">%s*%a") while e ~= nil do if mw.ustring.find(">", substr(str, b,e)) == nil then return substr(str, 1, e-1) .. lang:ucfirst(substr(str,e,e)) ..substr(str, e+1) end b, e = mw.ustring.find(str, ">%s*%a", e) end return str end end
function p.capitalize(frame) return p.cap(frame.args[1]) end
return p</text>
<sha1>oi3oo9q42s5okxrm5hbfy01zk32pehp</sha1>
</revision>
</page>
<page>
<title>Template:Clear</title>
<ns>10</ns>
<id>12131100</id>
<revision>
<id>665474881</id>
<parentid>91992232</parentid>
<timestamp>2018-04-14T18:59:12Z</timestamp>
<contributor>
<username>Dataeast0000001</username>
<id>2952466</id>
</contributor>
<comment>move onlyinclude to noinclude</comment>
<origin>665474881</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="79" sha1="5aa2j06l3n3husy1g6jggf6oznzocau" xml:space="preserve"><div style="clear:both;"></div><noinclude>Template:Documentation</noinclude></text>
<sha1>5aa2j06l3n3husy1g6jggf6oznzocau</sha1>
</revision>
</page>
<page>
<title>Module:Fallback</title>
<ns>828</ns>
<id>19181086</id>
<revision>
<id>714642825</id>
<parentid>714642495</parentid>
<timestamp>2018-07-23T16:35:03Z</timestamp>
<contributor>
<username>Matěj Suchánek</username>
<id>53613</id>
</contributor>
<minor/>
<comment>fix</comment>
<origin>714642825</origin>
<model>Scribunto</model>
<format>text/plain</format>
<text bytes="5559" sha1="6vr2in87podxnsj3x2jttt1r1qisf9q" xml:space="preserve">local p = {}
function p.fblist(lang, langonly) -- list the full fallback chain from a language to en local fbtable = mw.language.getFallbacksFor(lang) table.insert(fbtable, 1, lang) if not langonly then table.insert(fbtable, 'message') table.insert(fbtable, 'item') table.insert(fbtable, 'default') end return fbtable end
function p._langSwitch(args, lang) -- args: table of translations -- Return error if there is not default and no English version -- otherwise returns the message in the most appropriate, plus the lang code as a second value if not args.en and not args.default and not args.message and not args.item and args.nocat ~= '1' then return error("langSwitch error: no default") end -- get language (either stated one or user's default language) if not lang then return '<strong class="error">LangSwitch Error: no lang</strong>' -- must become proper error end -- get the list of acceptable language (lang + those in lang's fallback chain) and check their content for i, j in ipairs(p.fblist(lang)) do if args[j] then if args[j] == '~' then return nil, j end if j == 'item' then local label, lang = mw.wikibase.getLabelWithLang(args[j]) if label then return label, lang else return args[j], 'en' end end if j == 'message' then return tostring(mw.message.new(args[j]):inLanguage(lang)) end -- if this is an interface message if args[j] ~= then return args[j], j end end end return nil end
function p.langSwitch(frame) -- version to be used from wikitext local args = frame.args -- if no expected args provided than check parent template/module args if not args.en and not args.default and not args.nocat then args = frame:getParent().args end local lang if args.lang and args.lang ~= then lang = args.lang args.lang = nil else -- get user's chosen language lang = frame:preprocess( "⧼lang⧽" ) end local str, language = p._langSwitch(args, lang) return str -- get the first value of the langSwitch, (the text) not the second (the language) end
function p.fallbackpage(base, lang, formatting) local languages = p.fblist(lang) for i, lng in ipairs(languages) do if mw.title.new(base .. '/' .. lng).exists then if formatting == 'table' then return {base .. '/' .. lng, lng} -- returns name of the page + name of the language else return base .. '/' .. lng -- returns only the page end end end return base end
function p.autotranslate(frame) -- logic for template:Autotranslate local args = frame.args if not args.lang or args.lang == then args.lang = frame:preprocess( "⧼lang⧽" ) -- get user's chosen language end
-- find base page local base = args.base if not base or base == then return '<strong class="error">Base page not provided for autotranslate</strong>' end if string.sub(base, 2, 9) ~= 'emplate:' then base = 'Template:' .. base -- base provided without 'Template:' part end
-- find base template language subpage local page = p.fallbackpage(base, args.lang) -- if (not page and base ~= args.base) then -- try the original args.base string. This case is only needed if base is not in template namespace page = p.fallbackpage(args.base, args.lang) end if not page then return string.format('<strong class="error">no fallback page found for autotranslate (base=%s, lang=%s)</strong>', args.base, args.lang) end
-- repack args in a standard table local newargs = {} for field, value in pairs(args) do if field ~= 'base' then newargs[field] = value end end
-- Transclude Template:Page with template arguments the same as the ones passed to Template:Autotranslate template. return frame:expandTemplate{ title = page, args = newargs } end
function p.translate(page, key, lang) --translate data stored in a module if type(page) == 'string' then -- if the requested translation table is not yet loaded page = require('Module:' .. page) end
local val if page[key] then val = page[key] elseif page.keys and page.keys[key] then-- key 'keys" is an index of all keys, including redirects, see Module:i18n/datatype val = page.keys[key] end if not val then return '<' .. key .. '>' end return p._langSwitch(val, lang) end
function p.translatelua(frame) local lang = frame.args.lang local page = require('Module:' .. mw.text.trim(frame.args[1])) -- page should only contain a simple of translations if not lang or mw.text.trim(lang) == then lang = frame:preprocess( "⧼lang⧽" ) end if frame.args[2] then page = page[mw.text.trim(frame.args[2])] end return p._langSwitch(page, lang) end
function p.runTests() local toFallbackTest = require('Module:Fallback/tests/fallbacks') local result = true
mw.log('Testing fallback chains') for i, t in ipairs(toFallbackTest) do local fbtbl = table.concat(p.fblist(t.initial), ', ') local expected = table.concat(t.expected, ', ') local ret = (fbtbl == expected) mw.log(i, ret and 'passed' or 'FAILED', t.initial, (not ret) and ('FAILED\nis >>' .. fbtbl .. '<<\nbut should be >>' .. expected .. '<<\n') or ) result = result and ret end
return result end
function p.showTemplateArguments(frame) -- list all input arguments of the template that calls "Script error: No such module "Fallback"." local str = for name, value in pairs( frame:getParent().args ) do if str == then str = string.format('%s=%s', name, value) -- argument #1 else str = string.format('%s, %s=%s', str, name, value) -- the rest end end return str end
return p</text>
<sha1>6vr2in87podxnsj3x2jttt1r1qisf9q</sha1>
</revision>
</page>
<page>
<title>Template:Ll</title>
<ns>10</ns>
<id>3264473</id>
<revision>
<id>618665821</id>
<parentid>443393354</parentid>
<timestamp>2018-01-11T02:59:59Z</timestamp>
<contributor>
<username>Jarekt</username>
<id>1274</id>
</contributor>
<comment>Fulfilling edit request by User:Kaganer. Thanks for helping!</comment>
<origin>618665821</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="178" sha1="h8s4unutwk14jcbyfcq88r5yvqbu5x5" xml:space="preserve">[[Special:MyLanguage/{{{1}}}{{#if:|#{{{anchor}}}}}|Template:PDT</includeonly>]]<noinclude>
Template:Documentation </noinclude></text>
<sha1>h8s4unutwk14jcbyfcq88r5yvqbu5x5</sha1>
</revision>
</page>
<page>
<title>Template:TranslateThis</title>
<ns>10</ns>
<id>16552759</id>
<revision>
<id>483148362</id>
<parentid>483129342</parentid>
<timestamp>2017-05-08T01:54:31Z</timestamp>
<contributor>
<username>MKar</username>
<id>6110</id>
</contributor>
<minor/>
<comment>Undid revision 483129342 by 70.71.90.6 (talk)</comment>
<origin>483148362</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="97" sha1="rm4lztokzfib496c8sbt9q36vx6n9tz" xml:space="preserve"><includeonly>Script error: No such module "TranslateThis".</includeonly><noinclude>Template:Documentation</noinclude></text>
<sha1>rm4lztokzfib496c8sbt9q36vx6n9tz</sha1>
</revision>
</page>
<page>
<title>Module:TranslateThis</title>
<ns>828</ns>
<id>16552706</id>
<revision>
<id>2144500220</id>
<parentid>1980692436</parentid>
<timestamp>2024-05-04T13:29:50Z</timestamp>
<contributor>
<username>Uzume</username>
<id>11596</id>
</contributor>
<comment>switch frame:preprocess("⧼lang⧽") to callParserFunction("int", "lang")</comment>
<origin>2144500220</origin>
<model>Scribunto</model>
<format>text/plain</format>
<text bytes="1738" sha1="j2it1vjxk477pw54t7yheap3g9xt452" xml:space="preserve">local fb = require('Module:Fallback')
local dir = require('Module:Dir')
return { main = function( frame )
local function shallowcopy(orig) if type(orig) ~= 'table' then return orig end
local result = {} for key, value in pairs(orig) do result[key] = value end return result end
local args = shallowcopy(frame:getParent().args) local lang = args.lang or frame:callParserFunction("int", "lang") -- I don't know of any other way to get the user's language... args.lang = nil
local anchor = args.anchor args.anchor = nil if (anchor and args[anchor]) then anchor = args[anchor] end anchor = anchor and frame:expandTemplate( { title = "Anchor", args = { anchor } } ) or
local result = args[ lang ] if result and result ~= then result = '<span dir="' .. dir.select(lang, 'rtl', 'ltr') .. '" lang="' .. lang .. '">' .. result .. '</span>' else local default = {} for i, v in pairs( args ) do if v ~= "" then table.insert(default, '<span dir="' .. dir.select(i, 'rtl', 'ltr') .. '" lang="' .. i .. '">' .. v .. '</span> <small>(' .. i .. ')</small>') end end default = table.concat(default, ' / ') args.default=default local newlang result, newlang = fb._langSwitch(args, lang) if not newlang then result = elseif newlang~='default' then result = '<span dir="' .. dir.select(newlang, 'rtl', 'ltr') .. '" lang="' .. newlang .. '">' .. result .. '</span> <small>(' .. newlang .. ')</small>' end local langname = mw.language.fetchLanguageName( lang, lang ) if langname ~= "" and newlang then result = result .. " – " .. frame:expandTemplate( { title = "Help translate", args = { langname, lang = lang } } ) end end
return anchor .. result end}</text>
<sha1>j2it1vjxk477pw54t7yheap3g9xt452</sha1>
</revision>
</page>
<page>
<title>Module:Dir</title>
<ns>828</ns>
<id>95388294</id>
<revision>
<id>1935187194</id>
<parentid>1935159027</parentid>
<timestamp>2023-07-15T22:41:28Z</timestamp>
<contributor>
<username>Tacsipacsi</username>
<id>33956</id>
</contributor>
<comment>Undid revision 1935159027 by 177.232.91.83 (talk): test edit</comment>
<origin>1935187194</origin>
<model>Scribunto</model>
<format>text/plain</format>
<text bytes="5612" sha1="n6dnippb8dl8nupbrxgqviac0hno50v" xml:space="preserve">-- This module implements Template:Dir.
-- local rtlOverrides = mw.loadData('Module:Dir/RTL overrides') -- !!! mw.loadData() is currently broken, it does NOT load anything local rtlOverrides = require('Module:Dir/RTL overrides') local p = {}
local function trim(s)
if s and s ~= then s = tostring(s):match('^%s*(.-)%s*$') end
if s == then return nil end
return s
end
function p.rtlLangs(isRTL)
if isRTL == nil then isRTL = true end
return rtlOverrides[isRTL] or {}
end
function p.isRTL(code)
if type(code) ~= 'string' then return nil end
local v = rtlOverrides[code] -- very fast and not limited in the number of supported languages
if v ~= nil then return v end -- return it if mapped, otherwise use MediaWiki library:
local success, ret = pcall(function ()
return mw.language.new(code):isRTL() -- expensive and limited to 20 languages per MediaWiki instance
end)
return success and ret
end
function p.select(code, rtl, ltr)
if p.isRTL(code) then
return rtl
else
return ltr
end
end
-- Used via a template Template:Dir -- which just calls Script error: No such module "Dir"., the 3 parameters are automatically trimmed: -- Parameter 1 takes the default value from ⧼Lang⧽ if it's empty or not specified. -- Parameter 2 can be named rtl, may be explicitly empty, otherwise takes the default value 'rtl' only if it's not specified. -- Parameter 3 can be named ltr, may be explicitly empty, otherwise takes the default value 'ltr' only if it's not specified. function p.main(frame)
local args = frame:getParent().args -- Parameters used to transclude Template:Dir
local code = trim(args[1]) or frame:callParserFunction('Int', 'Lang')
local rtl = trim(args.rtl or args[2] or 'rtl')
local ltr = trim(args.ltr or args[3] or 'ltr')
return p.select(code, rtl, ltr)
end
setmetatable(p, { quickTests = function ()
local rtlLangs = p.rtlLangs(true) local ltrLangs = p.rtlLangs(false)
-- Basic check of data format
local function checkLangs(name, langs)
for k, lang in pairs(langs) do
assert(type(k) == 'number' and k == math.floor(k)
and type(lang) == 'string' and #lang >= 2 and #lang <= 16
and lang:find('^[a-z][%-0-9a-z]*[0-9a-z]$') == 1,
": Invalid sequence of language codes, " .. name .. "['" .. k .. "'] = '" .. lang .. "'")
end
return true
end
local ok, msg
ok, msg = pcall(checkLangs, 'rtlLangs', rtlLangs)
if not ok then return false, msg end
ok, msg = pcall(checkLangs, 'ltrLangs', ltrLangs)
if not ok then return false, msg end
-- Build inverse maps of languages having each direction
local isrtl, isltr = {}, {}
for _, lang in ipairs(rtlLangs) do isrtl[lang] = true end
for _, lang in ipairs(ltrLangs) do isltr[lang] = true end
-- Check conflicts using the two inverse maps
for _, lang in ipairs(rtlLangs) do
if isltr[lang] then return false, ": Direction conflict for '" .. lang .. "'" end
end
for _, lang in ipairs(ltrLangs) do
if isrtl[lang] then return false, ": Direction conflict for '" .. lang .. "'" end
end
-- Log missing languages (allows filling the tables above) according to MediaWiki internal data
local knownLangs, isKnownLang = mw.language.fetchLanguageNames(), {}
for lang, _ in pairs(knownLangs) do
isKnownLang[lang] = true
if rtlOverrides[lang] == nil then -- only if we still don't have data for this language
-- Note: we cannot check more than 20 languages at once, then MediaWiki raises an error.
-- So this test only runs on the Lua console, where you can update the tables at top.
-- This also means we cannot compare what MediaWiki returns with the direction we map here for all languages.
ok, value = pcall(function() return tostring(mw.language.new(lang):isRTL()) end)
mw.log("Warning: missing direction for language '" .. lang .. "', MediaWiki returns '" .. value .. "'")
end
end
-- utility: reverse order iterator on sequences
local function revipairs(t)
return function(t, i)
i = i - 1
local v = t[i]
if v == nil then return nil end
return i, v
end, t, #t + 1
end
-- Sort and deduplicate language code values (by scanning backward) for data cleanup
-- Also log languages having a direction mapping in this module but still not known by MediaWiki
table.sort(rtlLangs)
table.sort(ltrLangs)
for i, lang in revipairs(rtlLangs) do
if rtlLangs[i - 1] == rtlLangs[i] then table.remove(rtlLangs, i) end
if isKnownLang[lang] == nil then
mw.log("RTL language '" .. lang .. "' still not known by Mediawiki (could be a missing alias or variant)")
end
end
for i, lang in revipairs(ltrLangs) do
if ltrLangs[i - 1] == ltrLangs[i] then table.remove(ltrLangs, i) end
if isKnownLang[lang] == nil then
mw.log("LTR language '" .. lang .. "' still not known by Mediawiki (could be a missing alias or variant)")
end
end
-- Final presentation of current lists, sorted and deduplicated
mw.log("----")
mw.log("local rtlLangs = { '" .. table.concat(rtlLangs, "', '") .. "' }")
mw.log("local ltrLangs = { '" .. table.concat(ltrLangs, "', '") .. "' }")
return true
end }) --[==[ Enter this to run tests in the Lua console: =getmetatable(p).quickTests() --]==]
return p</text>
<sha1>n6dnippb8dl8nupbrxgqviac0hno50v</sha1>
</revision>
</page>
<page>
<title>Module:Dir/RTL overrides</title>
<ns>828</ns>
<id>95388411</id>
<revision>
<id>1223091335</id>
<timestamp>2020-07-03T04:07:06Z</timestamp>
<contributor>
<username>Amitie 10g</username>
<id>185006</id>
</contributor>
<comment>Created page with "local p = {} --[==[ Basic input sequences: relative order or duplicates does not matter here (but the end of the self test displays them sorted and deduplicated), but codes m..."</comment>
<origin>1223091335</origin>
<model>Scribunto</model>
<format>text/plain</format>
<text bytes="4566" sha1="cxld5o18iaxkhru8z4aje5lec04qed1" xml:space="preserve">local p = {}
--[==[ Basic input sequences: relative order or duplicates does not matter here (but the end of the self test displays them sorted and deduplicated), but codes must be valid and belong to only one of the two sequences).
Any missing language code will be checked with mw.language.new(code):isRTL(), which is costly in loaded resources (it can only check 20 languages at most including the content language) So it is best to map all languages that are the most likely to be used. --]==]
local rtlLangs = { 'aeb', 'aeb-arab', 'ar', 'arc', 'arq', 'ary', 'arz', 'azb', 'bcc', 'bgn', 'bqi', 'ckb', 'dv', 'fa', 'fa-af', 'glk', 'ha-arab', 'he', 'khw', 'kk-arab', 'kk-cn', 'ks-arab', 'ku-arab', 'lki', 'lrc', 'luz', 'mzn', 'nqo', 'ota', 'pnb', 'prd', 'ps', 'sd', 'sdh', 'skr', 'skr-arab', 'ug', 'ug-arab', 'ur', 'uz-arab', 'ydd', 'yi' }
local ltrLangs = { 'aa', 'ab', 'abs', 'ace', 'ady', 'ady-cyrl', 'aeb-latn', 'af', 'ak', 'aln', 'als', 'alt', 'am', 'ami', 'an', 'ang', 'anp', 'arn', 'as', 'ase', 'ast', 'atj', 'av', 'avk', 'awa', 'ay', 'az', 'ba', 'ban', 'bar', 'bat-smg', 'bbc', 'bbc-latn', 'bcl', 'be', 'be-tarask', 'be-x-old', 'bg', 'bh', 'bho', 'bi', 'bjn', 'bm', 'bn', 'bo', 'bpy', 'br', 'brh', 'bs', 'btm', 'bto', 'bu', 'bug', 'bxr', 'ca', 'cbk-zam', 'cdo', 'ce', 'ceb', 'ch', 'cho', 'chr', 'chy', 'co', 'cop', 'cps', 'cr', 'crh', 'crh-cyrl', 'crh-latn', 'cs', 'csb', 'cu', 'cv', 'cy', 'da', 'de', 'de-at', 'de-ch', 'de-formal', 'din', 'diq', 'dsb', 'dtp', 'dty', 'dz', 'ee', 'egl', 'el', 'eml', 'en', 'en-ca', 'en-gb', 'en-ie', 'en-us', 'eo', 'es', 'es-419', 'es-formal', 'et', 'eu', 'ext', 'ff', 'fi', 'fil', 'fit', 'fiu-vro', 'fj', 'fkv', 'fo', 'fr', 'frc', 'fro', 'frp', 'frr', 'fur', 'fy', 'ga', 'gag', 'gan', 'gan-hans', 'gan-hant', 'gcf', 'gcr', 'gd', 'gl', 'gn', 'gom', 'gom-deva', 'gom-latn', 'gor', 'got', 'grc', 'gsw', 'gu', 'gv', 'ha', 'hak', 'haw', 'hi', 'hif', 'hif-deva', 'hif-latn', 'hil', 'hmn', 'ho', 'hr', 'hrx', 'hsb', 'ht', 'hu', 'hu-formal', 'hy', 'hyw', 'hz', 'ia', 'id', 'ie', 'ig', 'ii', 'ik', 'ike-cans', 'ike-latn', 'ilo', 'inh', 'io', 'is', 'it', 'iu', 'ja', 'jam', 'jbo', 'jut', 'jv', 'ka', 'kaa', 'kab', 'kbd', 'kbd-cyrl', 'kbd-latn', 'kbp', 'kea', 'kg', 'ki', 'kiu', 'kj', 'kjp', 'kk', 'kk-cyrl', 'kk-kz', 'kk-latn', 'kk-tr', 'kl', 'km', 'kn', 'ko', 'ko-kp', 'ko-kr', 'koi', 'kr', 'krc', 'kri', 'krj', 'krl', 'ks', 'ks-deva', 'ksh', 'ku', 'ku-latn', 'kum', 'kv', 'kw', 'ky', 'la', 'lad', 'lb', 'lbe', 'lez', 'lfn', 'lg', 'li', 'lij', 'liv', 'lld', 'lmo', 'ln', 'lo', 'loz', 'lt', 'ltg', 'lus', 'lv', 'lzh', 'lzz', 'mai', 'map-bms', 'mdf', 'mg', 'mh', 'mhr', 'mi', 'min', 'mk', 'ml', 'mn', 'mni', 'mnw', 'mo', 'mr', 'mrj', 'ms', 'mt', 'mus', 'mwl', 'my', 'myv', 'na', 'nah', 'nan', 'nap', 'nb', 'nds', 'nds-nl', 'ne', 'new', 'ng', 'niu', 'nl', 'nl-informal', 'nn', 'no', 'nod', 'non', 'nov', 'nrf', 'nrf-fr', 'nrf-gg', 'nrf-je', 'nrm', 'nso', 'nv', 'ny', 'nys', 'oc', 'olo', 'om', 'or', 'os', 'pa', 'pag', 'pam', 'pap', 'pcd', 'pdc', 'pdt', 'pfl', 'pi', 'pih', 'pl', 'pms', 'pnt', 'prg', 'pt', 'pt-br', 'pt-cv', 'pt-pt', 'qu', 'quc', 'qug', 'rgn', 'rif', 'rm', 'rmf', 'rmy', 'rn', 'ro', 'roa-rup', 'roa-tara', 'ru', 'rue', 'rup', 'ruq', 'ruq-cyrl', 'ruq-latn', 'rw', 'rwr', 'sa', 'sah', 'sat', 'sc', 'scd', 'scn', 'sco', 'sdc', 'se', 'sei', 'ses', 'sg', 'sgs', 'sh', 'sh-cyrl', 'sh-latn', 'shi', 'shi-latn', 'shi-tfng', 'shn', 'shy-latn', 'si', 'simple', 'sjd', 'sje', 'sju', 'sk', 'sl', 'sli', 'sm', 'sma', 'smj', 'smn', 'sms', 'sn', 'so', 'sq', 'sr', 'sr-cyrl', 'sr-ec', 'sr-el', 'sr-latn', 'srn', 'srq', 'ss', 'st', 'stq', 'sty', 'su', 'sv', 'sw', 'szl', 'szy', 'ta', 'tay', 'tcy', 'te', 'tet', 'tg', 'tg-cyrl', 'tg-latn', 'th', 'ti', 'tk', 'tl', 'tly', 'tn', 'to', 'tokipona', 'tpi', 'tr', 'tru', 'trv', 'ts', 'tt', 'tt-cyrl', 'tt-latn', 'tum', 'tw', 'ty', 'tyv', 'tzl', 'tzm', 'udm', 'ug-latn', 'uk', 'uz', 'uz-cyrl', 'uz-latn', 've', 'vec', 'vep', 'vi', 'vls', 'vmf', 'vo', 'vot', 'vro', 'wa', 'war', 'wo', 'wuu', 'xal', 'xh', 'xmf', 'xsy', 'yo', 'yue', 'za', 'zea', 'zgh', 'zh', 'zh-classical', 'zh-cn', 'zh-hans', 'zh-hant', 'zh-hk', 'zh-min-nan', 'zh-mo', 'zh-my', 'zh-sg', 'zh-tw', 'zh-wuu', 'zh-yue', 'zu' }
-- Build the inverted map of languages to direction returned by this data module (fast, but collisions are not checked: run the test module) for _, lang in ipairs(rtlLangs) do p[lang] = true end for _, lang in ipairs(ltrLangs) do p[lang] = false end
-- Also store the two lists (at boolean indice), used by the test module to check the inverted map p[true] = rtlLangs p[false] = ltrLangs
return p</text>
<sha1>cxld5o18iaxkhru8z4aje5lec04qed1</sha1>
</revision>
</page>
<page>
<title>Template:SPARQLText</title>
<ns>10</ns>
<id>23033014</id>
<revision>
<id>1399250943</id>
<parentid>1399250772</parentid>
<timestamp>2021-04-10T14:44:00Z</timestamp>
<contributor>
<ip>87.126.92.234</ip>
</contributor>
<comment>Undid revision 1399250772 by 87.126.92.234 (talk)</comment>
<origin>1399250943</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="340" sha1="f35rnwtdn4sdogbp73jb3irfk0cvqp7" xml:space="preserve">{{#if:|
Template:IfTemplate:IfTemplate:IfTemplate:If }}{{{query}}}<noinclude>Template:Doc</noinclude></text>
<sha1>f35rnwtdn4sdogbp73jb3irfk0cvqp7</sha1>
</revision>
</page>
<page>
<title>Template:Int try it</title>
<ns>10</ns>
<id>109708780</id>
<redirect title="Template:Int run it" />
<revision>
<id>1764769125</id>
<timestamp>2022-11-04T21:44:15Z</timestamp>
<contributor>
<username>عُثمان</username>
<id>5050751</id>
</contributor>
<comment>عُثمان moved page Template:Int try it to Template:Int run it: the recent change to run it seems fine, but I was confused about where to find the template since the name did not match - move is inaccordance; redirects should resolve</comment>
<origin>1764769125</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="33" sha1="jwzw36nb8jui2zuk88ncwnse88o65qy" xml:space="preserve">#REDIRECT Template:Int run it</text>
<sha1>jwzw36nb8jui2zuk88ncwnse88o65qy</sha1>
</revision>
</page>
<page>
<title>Module:SPARQLMentions</title>
<ns>828</ns>
<id>28161729</id>
<revision>
<id>1453690994</id>
<parentid>661638891</parentid>
<timestamp>2021-07-04T13:54:47Z</timestamp>
<contributor>
<username>Azertus</username>
<id>1229135</id>
</contributor>
<comment>add getTitle</comment>
<origin>1453690994</origin>
<model>Scribunto</model>
<format>text/plain</format>
<text bytes="2760" sha1="lahzcbsmcekjpuk5o23yy8vvav8qfnz" xml:space="preserve">local p = {}
-- Return the label of a given data item, formatted for linking local function getLabel(frame, id, prefix) if prefix == nil then prefix = end if id == "defaultView:BubbleChart" then id = "Q24515280" end if id == "defaultView:Graph" then id = "Q24515287" end if id == "defaultView:Map" then id = "Q24515275" end
if id == "defaultView:ImageGrid" then id = "Q24515278" end
if id == "wikibase:box" then id = "Q26211169" end if id == "wikibase:cornerWest" then id = "Q26211177" end label = mw.wikibase.label( id ) if label == nil then linktext = id extra = else linktext = label .. " (" .. id .. ")" extra = ' ' .. frame:expandTemplate({ title="Reasonator", args= { [1] = id}}) .. ' ' .. frame:expandTemplate({ title="SQID", args= { [1] = id}}) end
link = mw.wikibase.getEntityUrl( id )
return '[' .. link .. ' ' .. linktext .. ']' .. extra; end
local function map(func, array)
local new_array = {}
for i,v in ipairs(array) do
new_array[i] = func(v)
end
return new_array
end
local function getAll(text, regexp, seen, items) if items == nil then items = {} end if seen == nil then seen = {} end for item in string.gmatch(text, regexp) do if seen[item] == nil then seen[item] = 1 table.insert(items, item) end end return items end
-- Produce list of items mentioned in the query
function p.getItems(frame)
if not mw.wikibase then
return "no mw.wikibase"
end
items = getAll(frame.args[1], 'wd:(Q%d+)') return table.concat(map(function(it) return getLabel(frame, it) end, items), ", ") end
-- Produce list of properties mentioned in the query function p.getProperties(frame) if not mw.wikibase then return "no mw.wikibase" end
seen = {} items = {} prefixes = {'wdt', 'p', 'ps', 'pr', 'pq', 'psv', 'pv', 'prv', 'pqv', 'wdtn', 'psn', 'pqn', 'prn', 'wdno' } for _, pr in ipairs(prefixes) do items = getAll(frame.args[1], pr .. ':(P%d+)', seen, items) end return table.concat(map(function(it) return getLabel(frame, it, 'Property:') end, items), ", ") end
function p.getFunctions(frame) if not mw.wikibase then return "no mw.wikibase" end
seen = {} items = {} func = {'defaultView:BubbleChart', 'defaultView:Graph', 'defaultView:Map', 'defaultView:ImageGrid', 'wikibase:box', "wikibase:cornerWest" } for _, pr in ipairs(func) do items = getAll(frame.args[1], pr, seen, items) end return table.concat(map(function(it) return getLabel(frame, it) end, items), ", ") end
function p.getTitle(frame) if not mw.wikibase then return "no mw.wikibase" end
for line in string.gmatch(frame.args[1], "[^%c]+%c?") do local title = string.match(line, '^#title:%s*([^%c]+)')
if not (title == nil) then return title end end end
return p</text>
<sha1>lahzcbsmcekjpuk5o23yy8vvav8qfnz</sha1>
</revision>
</page>
<page>
<title>Template:SQID</title>
<ns>10</ns>
<id>26259378</id>
<revision>
<id>1233859301</id>
<parentid>1227690908</parentid>
<timestamp>2020-07-18T14:13:28Z</timestamp>
<contributor>
<username>MisterSynergy</username>
<id>44949</id>
</contributor>
<comment>move URL to https://sqid.toolforge.org</comment>
<origin>1233859301</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="993" sha1="j6wq5aq6l7wsi92xtysclan6m8dprov" xml:space="preserve"><!--
-->{{#if: | Template:Q  }}<!-- -->{{#if: | Template:P  }}<!-- -->{{#if: | <span class="plainlinks">[https://sqid.toolforge.org/#{{#if:
| /view?id={{#if:
|
| {{#if:
| Q{{#titleparts:}}
| P{{#titleparts:}}
}}
}}&lang=⧼Lang⧽
| /?lang=⧼Lang⧽
}} ]</span>
}}<!-- --><nowiki/>?lang=⧼Lang⧽ }}<!-- --><noinclude>Template:Documentation</noinclude></text>
<sha1>j6wq5aq6l7wsi92xtysclan6m8dprov</sha1>
</revision>
</page>
<page>
<title>Template:Reasonator</title>
<ns>10</ns>
<id>17365939</id>
<revision>
<id>1556587517</id>
<parentid>1507464031</parentid>
<timestamp>2022-01-05T12:35:07Z</timestamp>
<contributor>
<username>Venca24</username>
<id>103280</id>
</contributor>
<comment>+ cs, eo</comment>
<origin>1556587517</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="882" sha1="ej9pd5v5fuipsemxo8gx8dbsqgg5vij" xml:space="preserve">{{#if:
| <span class="plainlinks">[1]</span> }} Template:TranslateThis<noinclude>Template:Documentation</noinclude></text>
<sha1>ej9pd5v5fuipsemxo8gx8dbsqgg5vij</sha1>
</revision>
</page>
<page>
<title>Template:WikiProject</title>
<ns>10</ns>
<id>21790485</id>
<revision>
<id>2298079997</id>
<parentid>2053606357</parentid>
<timestamp>2025-01-14T09:49:46Z</timestamp>
<contributor>
<username>Mormegil</username>
<id>28758</id>
</contributor>
<comment>+cs</comment>
<origin>2298079997</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="2446" sha1="afrxihplnkiijrydcgi7kwzg00a84sv" xml:space="preserve"><noinclude>Template:Doc</noinclude><!--
-->{{#ifexist: Wikidata:WikiProject <!--
#then:
-->|{{#if:<!--
#then:
-->|Template:Section link<!--
#else:
-->|Template:Ll<!--
-->}}<!--
#else:
-->|{{error<!--
-->|Template:TranslateThis<!--
-->}}<!--
--> <small>Template:TranslateThis<!--
--></small><!--
-->}}</text>
<sha1>afrxihplnkiijrydcgi7kwzg00a84sv</sha1>
</revision>
</page>
<page>
<title>Template:WikiProject/pagename</title>
<ns>10</ns>
<id>22491841</id>
<revision>
<id>1294585707</id>
<parentid>238479307</parentid>
<timestamp>2020-10-19T21:05:53Z</timestamp>
<contributor>
<username>Tacsipacsi</username>
<id>33956</id>
</contributor>
<comment>substitute template that doesn’t do what its name suggests and what it does in other projects</comment>
<origin>1294585707</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="60" sha1="8o2k69wu2sme8f490aakwi7ynj63jjv" xml:space="preserve">{{#if:|Wikidata Talk|Wikidata}}:WikiProject {{{1}}}</text>
<sha1>8o2k69wu2sme8f490aakwi7ynj63jjv</sha1>
</revision>
</page>
<page>
<title>Template:ItemOrNot</title>
<ns>10</ns>
<id>28161695</id>
<revision>
<id>361346548</id>
<parentid>361300782</parentid>
<timestamp>2016-08-02T21:22:10Z</timestamp>
<contributor>
<username>Smalyshev (WMF)</username>
<id>1482806</id>
</contributor>
<origin>361346548</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="384" sha1="230nkvb4w9pmw09vu3optxajqkjdr42" xml:space="preserve">{{#if: | * {{{1}}}: | }}<noinclude>
<templatedata> { "params": { "1": { "label": "List item name", "type": "string", "required": true }, "2": { "description": "List item contents", "type": "string" } }, "description": "Displays list item if second argument is not empty, otherwise nothing", "format": "block" } </templatedata> </noinclude></text>
<sha1>230nkvb4w9pmw09vu3optxajqkjdr42</sha1>
</revision>
</page>
<page>
<title>Template:Int Properties</title>
<ns>10</ns>
<id>25945270</id>
<revision>
<id>360948553</id>
<parentid>360948486</parentid>
<timestamp>2016-07-31T15:39:37Z</timestamp>
<contributor>
<username>Airon90</username>
<id>4782</id>
</contributor>
<origin>360948553</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="63" sha1="1f6bvc59pk8lngjngkff5ej07hrd17a" xml:space="preserve"><noinclude>Template:Doc</noinclude>Template:Capitalize</text>
<sha1>1f6bvc59pk8lngjngkff5ej07hrd17a</sha1>
</revision>
</page>
<page>
<title>Template:Int properties</title>
<ns>10</ns>
<id>25941214</id>
<revision>
<id>2504115378</id>
<parentid>2438818739</parentid>
<timestamp>2026-06-10T11:28:12Z</timestamp>
<contributor>
<username>مواطن تونسي</username>
<id>1537128</id>
</contributor>
<minor/>
<comment>traduction ar</comment>
<origin>2504115378</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="746" sha1="ao6colplfei84pspf07jmngpp7arssr" xml:space="preserve"><noinclude>Template:Doc</noinclude>Template:TranslateThis</text>
<sha1>ao6colplfei84pspf07jmngpp7arssr</sha1>
</revision>
</page>
<page>
<title>Template:SPARQL2/doc</title>
<ns>10</ns>
<id>35750675</id>
<revision>
<id>1425856775</id>
<parentid>1425856600</parentid>
<timestamp>2021-05-21T17:39:04Z</timestamp>
<contributor>
<username>PAC2</username>
<id>4892</id>
</contributor>
<comment>/* See also */ typo</comment>
<origin>1425856775</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="533" sha1="p2irk8qhdq7sqdc2n9kyjs3lvi2j5kw" xml:space="preserve"><nowiki><mediawiki xmlns="http://www.mediawiki.org/xml/export-0.11/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.11/ http://www.mediawiki.org/xml/export-0.11.xsd" version="0.11" xml:lang="en">
<siteinfo>
<sitename>Wikidata</sitename>
<dbname>wikidatawiki</dbname>
<base>https://www.wikidata.org/wiki/Wikidata:Main_Page</base>
<generator>MediaWiki 1.47.0-wmf.17</generator>
<case>first-letter</case>
<namespaces>
<namespace key="-2" case="first-letter">Media</namespace>
<namespace key="-1" case="first-letter">Special</namespace>
<namespace key="0" case="first-letter" />
<namespace key="1" case="first-letter">Talk</namespace>
<namespace key="2" case="first-letter">User</namespace>
<namespace key="3" case="first-letter">User talk</namespace>
<namespace key="4" case="first-letter">Wikidata</namespace>
<namespace key="5" case="first-letter">Wikidata talk</namespace>
<namespace key="6" case="first-letter">File</namespace>
<namespace key="7" case="first-letter">File talk</namespace>
<namespace key="8" case="first-letter">MediaWiki</namespace>
<namespace key="9" case="first-letter">MediaWiki talk</namespace>
<namespace key="10" case="first-letter">Template</namespace>
<namespace key="11" case="first-letter">Template talk</namespace>
<namespace key="12" case="first-letter">Help</namespace>
<namespace key="13" case="first-letter">Help talk</namespace>
<namespace key="14" case="first-letter">Category</namespace>
<namespace key="15" case="first-letter">Category talk</namespace>
<namespace key="120" case="first-letter">Property</namespace>
<namespace key="121" case="first-letter">Property talk</namespace>
<namespace key="122" case="first-letter">Query</namespace>
<namespace key="123" case="first-letter">Query talk</namespace>
<namespace key="146" case="first-letter">Lexeme</namespace>
<namespace key="147" case="first-letter">Lexeme talk</namespace>
<namespace key="640" case="first-letter">EntitySchema</namespace>
<namespace key="641" case="first-letter">EntitySchema talk</namespace>
<namespace key="710" case="first-letter">TimedText</namespace>
<namespace key="711" case="first-letter">TimedText talk</namespace>
<namespace key="828" case="first-letter">Module</namespace>
<namespace key="829" case="first-letter">Module talk</namespace>
<namespace key="1198" case="first-letter">Translations</namespace>
<namespace key="1199" case="first-letter">Translations talk</namespace>
<namespace key="1728" case="first-letter">Event</namespace>
<namespace key="1729" case="first-letter">Event talk</namespace>
<namespace key="2600" case="first-letter">Topic</namespace>
</namespaces>
</siteinfo>
<page>
<title>Template:SPARQL2</title>
<ns>10</ns>
<id>28161690</id>
<revision>
<id>2346047691</id>
<parentid>2346040648</parentid>
<timestamp>2025-05-08T12:02:25Z</timestamp>
<contributor>
<username>Madamebiblio</username>
<id>2952832</id>
</contributor>
<minor/>
<comment>Reverted edits by 201.143.205.181 (talk) to last revision by Kokage si</comment>
<origin>2294596805</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="7567" sha1="s4975lvx7s2i4pjji1govtxccu2rt3e" xml:space="preserve">Template:SPARQL2/doc
<onlyinclude>Template:Clear{{#ifeq:|{{{nohints}}}| <!--hidden hints--> | {{TranslateThis<!--
-->|ar=يستخدم الاستعلام التالي هذه:<!--
-->|be-tarask=Дадзены запыт выкарыстоўвае:<!--
-->|cs=Následující dotaz používá:<!--
-->|de=Die Suchanfrage verwendet:<!--
-->|en=The following query uses these:<!--
-->|en-gb=The following query uses these:<!--
-->|el=Το ακόλουθο ερώτημα χρησιμοποιεί αυτά:<!--
-->|es=La siguiente consulta utiliza lo siguiente:<!--
-->|fi=Seuraava kysely käyttää näitä:<!--
-->|fr=La requête suivante utilise ces :<!--
-->|hu=Ez a lekérdezés a következőket használja:<!--
-->|id=Kueri di bawah akan menggunakan entitas berikut:<!--
-->|it=La seguente query utilizza questi:<!--
-->|ja=以下のクエリではこれらを使用します:<!--
-->|nl=Deze query gebruikt:<!--
-->|pl=To zapytanie używa:<!--
-->|pt=A consulta seguinte utiliza estes:<!--
-->|pt-br=A consulta seguinte utiliza estes:<!--
-->|ru=Этот запрос использует:<!--
-->|sv=Följande fråga använder dessa:<!--
-->|tr=Aşağıdaki sorgu bunları kullanıyor:<!--
-->|uk=Цей запит використовує:<!--
-->}}<!-- -->Template:ItemOrNot <!-- -->Template:ItemOrNot <!-- -->Template:ItemOrNot <!--
-->}}
[[:Template:SPARQLText]]
<!-- --><div class="displayonly">{{#if: ||Template:Int try it}}</div>Template:Clear</onlyinclude><noinclude> <templatedata> { "params": { "query": { "required": true, "label": { "ar": "استعلام", "be-tarask": "запыт", "cs": "dotaz", "en": "query", "es": "consulta", "fr": "requête", "id": "kueri", "it": "query", "ja": "クエリ", "pl": "zapytanie", "pt": "consulta", "pt-br": "consulta", "sv": "fråga",
"tr": "sorgu",
"uk": "запит" }, "description": { "ar": "استعلام سباركل", "be-tarask": "запыт SPARQL", "cs": "SPARQL dotaz", "en": "SPARQL query", "es": "consulta SPARQL", "fr": "la requête que le modèle doit traiter et afficher", "id": "kueri SPARQL", "it": "query SPARQL", "ja": "SPARQLクエリ", "pl": "query SPARQL", "pt": "consulta SPARQL", "pt-br": "consulta SPARQL", "sv": "SPARQL fråga", "tr": "SPARQL sorgusu", "uk": "запит SPARQL" }, "example": { "be-tarask": "SELECT * WHERE { ?x wdt:P31 wd:Q5 } LIMIT 1", "cs": "SELECT * WHERE { ?x wdt:P31 wd:Q5 } LIMIT 1", "en": "SELECT * WHERE { ?x wdt:P31 wd:Q5 } LIMIT 1", "es": "SELECT ?item WHERE { ?item wdt:P31 wd:Q5 } LIMIT 1", "fr": "select ?item where { ?item wdt:P31 wd:Q5 } LIMIT 1", "id": "SELECT * WHERE { ?a wdt:P31 wd:Q5 } LIMIT 1", "it": "select ?item where { ?item wdt:P31 wd:Q5 } LIMIT 1", "pt": "select ?item where { ?item wdt:P31 wd:Q5 } LIMIT 1", "pt-br": "select ?item where { ?item wdt:P31 wd:Q5 } LIMIT 1" }, "type": "string", "aliases": [ "sparql" ], "suggested": true }, "extraprefix": { "description": { "ar": "بادئات إضافية لإضافتها",
"be-tarask": "дадатковыя прэфіксы (неабавязковыя)",
"cs": "Dodatečné prefixy (volitelné)", "en": "Extra prefixes to be added", "es": "Prefijos extra a añadir (opcional)", "fr": "les préfixes SPARQL non standards ou inconnus du service de requête éventuellement nécessaires (optionnel)", "id": "Prefiks SPARQL yang akan ditambahkan", "it": "Aggiungere i prefissi SPARQL non standard o sconosciuti eventualmente necessari (opzionale)", "ja": "追加する接頭辞(オプション)", "pl": "Dodatkowe prefiksy (opcjonalnie)", "pt": "Adicionar os prefixos SPARQL não padrões ou desconhecidos eventualmente necessários (opcional)", "pt-br": "Adicionar os prefixos SPARQL não padrões ou desconhecidos eventualmente necessários (opcional)", "uk": "Додаткові префікси (необов'язкові)" }, "example": "PREFIX wikibase: <http://wikiba.se/ontology#>", "type": "string" } }, "description": {
"be-tarask": "Гэты шаблён выводзіць запыт SPARQL з падсьветкай сынтаксісу, выкарыстаных элемэнтаў і спасылак на WDQS дзеля запуску запыту. \nЗРАБІЦЬ: скарыстаныя меткі элемэнтаў не лякалізаваныя",
"cs": "Tato šablona zobrazuje SPARQL dotaz ze zvýrazněnou syntaxí, použité položky a odkaz na WDQS dotazovací službu pro vyzkoušení.", "en": "This template displays SPARQL query with syntax highlighting, used items and link to WDQS query site to run the query. \nTODO: used items labels are not localized", "es": "Esta plantilla muestra una consulta SPARQL con resaltado de sintaxis, los items utilizados y un enlace al WDQS para lanzar la consulta", "fr": "Ce modèle affiche une requête SPARQL et permet de la lancer au travers du service de requête Wikidata. Il affiche aussi quelques informations basiques sur les éléments et fonctionnalités utilisées par cette requête", "id": "Templat ini menampilkan kueri SPARQL dengan pembedaan warna pada sintaks beserta entitas Wikidata yang digunakan dan pranala kueri di WDQS.", "it": "Questo template mostra una query SPARQL evidenziandone la sintassi e gli elementi usati e fornisce un link alla query WDQS site che permette di lanciare la query", "ja": "このテンプレートは構文強調付きのSPARQLクエリ、使用した項目、クエリを実行するWDQSクエリサイトへのリンクを表示します。", "pl": "Szablon wyświetla zapytanie SPARQL z podświetlaniem składni, listą użytych elementów i linkiem do WDQS.", "pt": "Esta predefinição mostra uma consulta SPARQL na qual evidencia a sintaxe e os elementos usados e fornece um enlace ao site WDQS que permite executar a consulta", "pt-br": "Esta predefinição mostra uma consulta SPARQL na qual evidencia a sintaxe e os elementos usados e fornece um enlace ao site WDQS que permite executar a consulta", "sv": "Denna mall visar en SPARQL fråga med syntaxfärgning, använda objekt och länk till WDQS frågesajten för att köra frågan. \nTODO: använda objekts etiketter är inte lokaliserade", "uk": "Цей шаблон показує запит SPARQL з підсвічуванням елементів синтаксису, список використаних елементів і посилання на сайт WDQS-запиту." }, "paramOrder": [ "query", "extraprefix" ], "format": "block" } </templatedata> </noinclude></text>
<sha1>s4975lvx7s2i4pjji1govtxccu2rt3e</sha1>
</revision>
</page>
<page>
<title>Template:Template</title>
<ns>10</ns>
<id>12414</id>
<redirect title="Template:Tl" />
<revision>
<id>431881</id>
<parentid>312894</parentid>
<timestamp>2012-11-13T02:07:50Z</timestamp>
<contributor>
<username>~riley</username>
<id>2219</id>
</contributor>
<comment>http://en.wikipedia.org/w/index.php?title=Template:Template&action=edit</comment>
<origin>431881</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="25" sha1="cdpzj9yp99pn5v093b404f4sc7cybv1" xml:space="preserve">#REDIRECT Template:Tl</text>
<sha1>cdpzj9yp99pn5v093b404f4sc7cybv1</sha1>
</revision>
</page>
<page>
<title>Template:Tl</title>
<ns>10</ns>
<id>3170</id>
<revision>
<id>2508986920</id>
<parentid>1946850712</parentid>
<timestamp>2026-06-22T01:25:21Z</timestamp>
<contributor>
<username>RogueScholar</username>
<id>3003918</id>
</contributor>
<minor/>
<comment>Format template code for readability and convert numeric HTML entities to named equivalents to accomplish the same</comment>
<origin>2508986920</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="1299" sha1="dqel96mgakegupz568kpnt91rdib9m4" xml:space="preserve"><includeonly><code>{{{{#if:|subst:}}<!-- Begin evaluation of first parameter.
-->{{#ifeq:{|:|:[[]]|<!-- If already prefixed by colon, show the link as such, too.
-->{{#switch:<!-- Target's namespace determines the link format. -->
| | Template = [[Template:|]]<!-- Main: (absent) or Template: namespaces -->
| File | Category = [[:{{{1}}}]]<!-- File and Category namespaces receive hidden colon prefix. -->
| #default = [[{{{1}}}]]<!-- All others are linked verbatim.
-->}}<!-- End of switch function. -->}}<!-- End of first parameter evaluation.
-->{{#ifeq: {{{2}}}| x||{{{2}}}}}<!--
-->{{#ifeq: {{{3}}}| x||{{{3}}}}}<!--
-->{{#ifeq: {{{4}}}| x||{{{4}}}}}<!--
-->{{#ifeq: {{{5}}}| x||{{{5}}}}}<!--
-->{{#ifeq: {{{6}}}| x||{{{6}}}}}<!--
-->{{#ifeq: {{{7}}}| x||{{{7}}}}}<!--
-->{{#ifeq: {{{8}}}| x||{{{8}}}}}<!--
-->{{#ifeq: {{{9}}}| x||{{{9}}}}}<!--
-->{{#ifeq:{{{10}}}|x||{{{10}}}}}}}</code></includeonly><noinclude>
Template:Documentation</noinclude></text>
<sha1>dqel96mgakegupz568kpnt91rdib9m4</sha1>
</revision>
</page>
<page>
<title>Template:Capitalize</title>
<ns>10</ns>
<id>24835143</id>
<revision>
<id>2283223741</id>
<parentid>2282968755</parentid>
<timestamp>2024-12-03T22:55:49Z</timestamp>
<contributor>
<username>Tacsipacsi</username>
<id>33956</id>
</contributor>
<comment>Undid revision 2282968755 by 2806:2F0:A080:F124:78E9:9300:6983:EA83 (talk): ???</comment>
<origin>2283223741</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="100" sha1="08bgnnmlolmwjwag381zkq615fl2s0a" xml:space="preserve"><includeonly>Script error: No such module "Capitalize".</includeonly><noinclude>
Template:Doc </noinclude></text>
<sha1>08bgnnmlolmwjwag381zkq615fl2s0a</sha1>
</revision>
</page>
<page>
<title>Template:Int items</title>
<ns>10</ns>
<id>28641837</id>
<revision>
<id>2438810545</id>
<parentid>2208740771</parentid>
<timestamp>2025-12-06T14:15:50Z</timestamp>
<contributor>
<username>YeBoy371</username>
<id>2200680</id>
</contributor>
<origin>2438810545</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="475" sha1="knyh87z85w0os01yxpmvrzvlnwf07fb" xml:space="preserve"><noinclude>Template:Doc</noinclude>Template:TranslateThis</text>
<sha1>knyh87z85w0os01yxpmvrzvlnwf07fb</sha1>
</revision>
</page>
<page>
<title>Module:Capitalize</title>
<ns>828</ns>
<id>25940912</id>
<revision>
<id>333880118</id>
<parentid>327538585</parentid>
<timestamp>2016-05-08T21:08:10Z</timestamp>
<contributor>
<username>TomT0m</username>
<id>7333</id>
</contributor>
<comment>cap after the tags</comment>
<origin>333880118</origin>
<model>Scribunto</model>
<format>text/plain</format>
<text bytes="518" sha1="oi3oo9q42s5okxrm5hbfy01zk32pehp" xml:space="preserve">
local p = {}
function p.cap(str) lang = mw.getContentLanguage() if lang:ucfirst(str) ~= str then return lang:ucfirst(str) else local substr = mw.ustring.sub b, e = mw.ustring.find(str, ">%s*%a") while e ~= nil do if mw.ustring.find(">", substr(str, b,e)) == nil then return substr(str, 1, e-1) .. lang:ucfirst(substr(str,e,e)) ..substr(str, e+1) end b, e = mw.ustring.find(str, ">%s*%a", e) end return str end end
function p.capitalize(frame) return p.cap(frame.args[1]) end
return p</text>
<sha1>oi3oo9q42s5okxrm5hbfy01zk32pehp</sha1>
</revision>
</page>
<page>
<title>Template:Clear</title>
<ns>10</ns>
<id>12131100</id>
<revision>
<id>665474881</id>
<parentid>91992232</parentid>
<timestamp>2018-04-14T18:59:12Z</timestamp>
<contributor>
<username>Dataeast0000001</username>
<id>2952466</id>
</contributor>
<comment>move onlyinclude to noinclude</comment>
<origin>665474881</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="79" sha1="5aa2j06l3n3husy1g6jggf6oznzocau" xml:space="preserve"><div style="clear:both;"></div><noinclude>Template:Documentation</noinclude></text>
<sha1>5aa2j06l3n3husy1g6jggf6oznzocau</sha1>
</revision>
</page>
<page>
<title>Module:Fallback</title>
<ns>828</ns>
<id>19181086</id>
<revision>
<id>714642825</id>
<parentid>714642495</parentid>
<timestamp>2018-07-23T16:35:03Z</timestamp>
<contributor>
<username>Matěj Suchánek</username>
<id>53613</id>
</contributor>
<minor/>
<comment>fix</comment>
<origin>714642825</origin>
<model>Scribunto</model>
<format>text/plain</format>
<text bytes="5559" sha1="6vr2in87podxnsj3x2jttt1r1qisf9q" xml:space="preserve">local p = {}
function p.fblist(lang, langonly) -- list the full fallback chain from a language to en local fbtable = mw.language.getFallbacksFor(lang) table.insert(fbtable, 1, lang) if not langonly then table.insert(fbtable, 'message') table.insert(fbtable, 'item') table.insert(fbtable, 'default') end return fbtable end
function p._langSwitch(args, lang) -- args: table of translations -- Return error if there is not default and no English version -- otherwise returns the message in the most appropriate, plus the lang code as a second value if not args.en and not args.default and not args.message and not args.item and args.nocat ~= '1' then return error("langSwitch error: no default") end -- get language (either stated one or user's default language) if not lang then return '<strong class="error">LangSwitch Error: no lang</strong>' -- must become proper error end -- get the list of acceptable language (lang + those in lang's fallback chain) and check their content for i, j in ipairs(p.fblist(lang)) do if args[j] then if args[j] == '~' then return nil, j end if j == 'item' then local label, lang = mw.wikibase.getLabelWithLang(args[j]) if label then return label, lang else return args[j], 'en' end end if j == 'message' then return tostring(mw.message.new(args[j]):inLanguage(lang)) end -- if this is an interface message if args[j] ~= then return args[j], j end end end return nil end
function p.langSwitch(frame) -- version to be used from wikitext local args = frame.args -- if no expected args provided than check parent template/module args if not args.en and not args.default and not args.nocat then args = frame:getParent().args end local lang if args.lang and args.lang ~= then lang = args.lang args.lang = nil else -- get user's chosen language lang = frame:preprocess( "⧼lang⧽" ) end local str, language = p._langSwitch(args, lang) return str -- get the first value of the langSwitch, (the text) not the second (the language) end
function p.fallbackpage(base, lang, formatting) local languages = p.fblist(lang) for i, lng in ipairs(languages) do if mw.title.new(base .. '/' .. lng).exists then if formatting == 'table' then return {base .. '/' .. lng, lng} -- returns name of the page + name of the language else return base .. '/' .. lng -- returns only the page end end end return base end
function p.autotranslate(frame) -- logic for template:Autotranslate local args = frame.args if not args.lang or args.lang == then args.lang = frame:preprocess( "⧼lang⧽" ) -- get user's chosen language end
-- find base page local base = args.base if not base or base == then return '<strong class="error">Base page not provided for autotranslate</strong>' end if string.sub(base, 2, 9) ~= 'emplate:' then base = 'Template:' .. base -- base provided without 'Template:' part end
-- find base template language subpage local page = p.fallbackpage(base, args.lang) -- if (not page and base ~= args.base) then -- try the original args.base string. This case is only needed if base is not in template namespace page = p.fallbackpage(args.base, args.lang) end if not page then return string.format('<strong class="error">no fallback page found for autotranslate (base=%s, lang=%s)</strong>', args.base, args.lang) end
-- repack args in a standard table local newargs = {} for field, value in pairs(args) do if field ~= 'base' then newargs[field] = value end end
-- Transclude Template:Page with template arguments the same as the ones passed to Template:Autotranslate template. return frame:expandTemplate{ title = page, args = newargs } end
function p.translate(page, key, lang) --translate data stored in a module if type(page) == 'string' then -- if the requested translation table is not yet loaded page = require('Module:' .. page) end
local val if page[key] then val = page[key] elseif page.keys and page.keys[key] then-- key 'keys" is an index of all keys, including redirects, see Module:i18n/datatype val = page.keys[key] end if not val then return '<' .. key .. '>' end return p._langSwitch(val, lang) end
function p.translatelua(frame) local lang = frame.args.lang local page = require('Module:' .. mw.text.trim(frame.args[1])) -- page should only contain a simple of translations if not lang or mw.text.trim(lang) == then lang = frame:preprocess( "⧼lang⧽" ) end if frame.args[2] then page = page[mw.text.trim(frame.args[2])] end return p._langSwitch(page, lang) end
function p.runTests() local toFallbackTest = require('Module:Fallback/tests/fallbacks') local result = true
mw.log('Testing fallback chains') for i, t in ipairs(toFallbackTest) do local fbtbl = table.concat(p.fblist(t.initial), ', ') local expected = table.concat(t.expected, ', ') local ret = (fbtbl == expected) mw.log(i, ret and 'passed' or 'FAILED', t.initial, (not ret) and ('FAILED\nis >>' .. fbtbl .. '<<\nbut should be >>' .. expected .. '<<\n') or ) result = result and ret end
return result end
function p.showTemplateArguments(frame) -- list all input arguments of the template that calls "Script error: No such module "Fallback"." local str = for name, value in pairs( frame:getParent().args ) do if str == then str = string.format('%s=%s', name, value) -- argument #1 else str = string.format('%s, %s=%s', str, name, value) -- the rest end end return str end
return p</text>
<sha1>6vr2in87podxnsj3x2jttt1r1qisf9q</sha1>
</revision>
</page>
<page>
<title>Template:Ll</title>
<ns>10</ns>
<id>3264473</id>
<revision>
<id>618665821</id>
<parentid>443393354</parentid>
<timestamp>2018-01-11T02:59:59Z</timestamp>
<contributor>
<username>Jarekt</username>
<id>1274</id>
</contributor>
<comment>Fulfilling edit request by User:Kaganer. Thanks for helping!</comment>
<origin>618665821</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="178" sha1="h8s4unutwk14jcbyfcq88r5yvqbu5x5" xml:space="preserve">[[Special:MyLanguage/{{{1}}}{{#if:|#{{{anchor}}}}}|Template:PDT</includeonly>]]<noinclude>
Template:Documentation </noinclude></text>
<sha1>h8s4unutwk14jcbyfcq88r5yvqbu5x5</sha1>
</revision>
</page>
<page>
<title>Template:TranslateThis</title>
<ns>10</ns>
<id>16552759</id>
<revision>
<id>483148362</id>
<parentid>483129342</parentid>
<timestamp>2017-05-08T01:54:31Z</timestamp>
<contributor>
<username>MKar</username>
<id>6110</id>
</contributor>
<minor/>
<comment>Undid revision 483129342 by 70.71.90.6 (talk)</comment>
<origin>483148362</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="97" sha1="rm4lztokzfib496c8sbt9q36vx6n9tz" xml:space="preserve"><includeonly>Script error: No such module "TranslateThis".</includeonly><noinclude>Template:Documentation</noinclude></text>
<sha1>rm4lztokzfib496c8sbt9q36vx6n9tz</sha1>
</revision>
</page>
<page>
<title>Module:TranslateThis</title>
<ns>828</ns>
<id>16552706</id>
<revision>
<id>2144500220</id>
<parentid>1980692436</parentid>
<timestamp>2024-05-04T13:29:50Z</timestamp>
<contributor>
<username>Uzume</username>
<id>11596</id>
</contributor>
<comment>switch frame:preprocess("⧼lang⧽") to callParserFunction("int", "lang")</comment>
<origin>2144500220</origin>
<model>Scribunto</model>
<format>text/plain</format>
<text bytes="1738" sha1="j2it1vjxk477pw54t7yheap3g9xt452" xml:space="preserve">local fb = require('Module:Fallback')
local dir = require('Module:Dir')
return { main = function( frame )
local function shallowcopy(orig) if type(orig) ~= 'table' then return orig end
local result = {} for key, value in pairs(orig) do result[key] = value end return result end
local args = shallowcopy(frame:getParent().args) local lang = args.lang or frame:callParserFunction("int", "lang") -- I don't know of any other way to get the user's language... args.lang = nil
local anchor = args.anchor args.anchor = nil if (anchor and args[anchor]) then anchor = args[anchor] end anchor = anchor and frame:expandTemplate( { title = "Anchor", args = { anchor } } ) or
local result = args[ lang ] if result and result ~= then result = '<span dir="' .. dir.select(lang, 'rtl', 'ltr') .. '" lang="' .. lang .. '">' .. result .. '</span>' else local default = {} for i, v in pairs( args ) do if v ~= "" then table.insert(default, '<span dir="' .. dir.select(i, 'rtl', 'ltr') .. '" lang="' .. i .. '">' .. v .. '</span> <small>(' .. i .. ')</small>') end end default = table.concat(default, ' / ') args.default=default local newlang result, newlang = fb._langSwitch(args, lang) if not newlang then result = elseif newlang~='default' then result = '<span dir="' .. dir.select(newlang, 'rtl', 'ltr') .. '" lang="' .. newlang .. '">' .. result .. '</span> <small>(' .. newlang .. ')</small>' end local langname = mw.language.fetchLanguageName( lang, lang ) if langname ~= "" and newlang then result = result .. " – " .. frame:expandTemplate( { title = "Help translate", args = { langname, lang = lang } } ) end end
return anchor .. result end}</text>
<sha1>j2it1vjxk477pw54t7yheap3g9xt452</sha1>
</revision>
</page>
<page>
<title>Module:Dir</title>
<ns>828</ns>
<id>95388294</id>
<revision>
<id>1935187194</id>
<parentid>1935159027</parentid>
<timestamp>2023-07-15T22:41:28Z</timestamp>
<contributor>
<username>Tacsipacsi</username>
<id>33956</id>
</contributor>
<comment>Undid revision 1935159027 by 177.232.91.83 (talk): test edit</comment>
<origin>1935187194</origin>
<model>Scribunto</model>
<format>text/plain</format>
<text bytes="5612" sha1="n6dnippb8dl8nupbrxgqviac0hno50v" xml:space="preserve">-- This module implements Template:Dir.
-- local rtlOverrides = mw.loadData('Module:Dir/RTL overrides') -- !!! mw.loadData() is currently broken, it does NOT load anything local rtlOverrides = require('Module:Dir/RTL overrides') local p = {}
local function trim(s)
if s and s ~= then s = tostring(s):match('^%s*(.-)%s*$') end
if s == then return nil end
return s
end
function p.rtlLangs(isRTL)
if isRTL == nil then isRTL = true end
return rtlOverrides[isRTL] or {}
end
function p.isRTL(code)
if type(code) ~= 'string' then return nil end
local v = rtlOverrides[code] -- very fast and not limited in the number of supported languages
if v ~= nil then return v end -- return it if mapped, otherwise use MediaWiki library:
local success, ret = pcall(function ()
return mw.language.new(code):isRTL() -- expensive and limited to 20 languages per MediaWiki instance
end)
return success and ret
end
function p.select(code, rtl, ltr)
if p.isRTL(code) then
return rtl
else
return ltr
end
end
-- Used via a template Template:Dir -- which just calls Script error: No such module "Dir"., the 3 parameters are automatically trimmed: -- Parameter 1 takes the default value from ⧼Lang⧽ if it's empty or not specified. -- Parameter 2 can be named rtl, may be explicitly empty, otherwise takes the default value 'rtl' only if it's not specified. -- Parameter 3 can be named ltr, may be explicitly empty, otherwise takes the default value 'ltr' only if it's not specified. function p.main(frame)
local args = frame:getParent().args -- Parameters used to transclude Template:Dir
local code = trim(args[1]) or frame:callParserFunction('Int', 'Lang')
local rtl = trim(args.rtl or args[2] or 'rtl')
local ltr = trim(args.ltr or args[3] or 'ltr')
return p.select(code, rtl, ltr)
end
setmetatable(p, { quickTests = function ()
local rtlLangs = p.rtlLangs(true) local ltrLangs = p.rtlLangs(false)
-- Basic check of data format
local function checkLangs(name, langs)
for k, lang in pairs(langs) do
assert(type(k) == 'number' and k == math.floor(k)
and type(lang) == 'string' and #lang >= 2 and #lang <= 16
and lang:find('^[a-z][%-0-9a-z]*[0-9a-z]$') == 1,
": Invalid sequence of language codes, " .. name .. "['" .. k .. "'] = '" .. lang .. "'")
end
return true
end
local ok, msg
ok, msg = pcall(checkLangs, 'rtlLangs', rtlLangs)
if not ok then return false, msg end
ok, msg = pcall(checkLangs, 'ltrLangs', ltrLangs)
if not ok then return false, msg end
-- Build inverse maps of languages having each direction
local isrtl, isltr = {}, {}
for _, lang in ipairs(rtlLangs) do isrtl[lang] = true end
for _, lang in ipairs(ltrLangs) do isltr[lang] = true end
-- Check conflicts using the two inverse maps
for _, lang in ipairs(rtlLangs) do
if isltr[lang] then return false, ": Direction conflict for '" .. lang .. "'" end
end
for _, lang in ipairs(ltrLangs) do
if isrtl[lang] then return false, ": Direction conflict for '" .. lang .. "'" end
end
-- Log missing languages (allows filling the tables above) according to MediaWiki internal data
local knownLangs, isKnownLang = mw.language.fetchLanguageNames(), {}
for lang, _ in pairs(knownLangs) do
isKnownLang[lang] = true
if rtlOverrides[lang] == nil then -- only if we still don't have data for this language
-- Note: we cannot check more than 20 languages at once, then MediaWiki raises an error.
-- So this test only runs on the Lua console, where you can update the tables at top.
-- This also means we cannot compare what MediaWiki returns with the direction we map here for all languages.
ok, value = pcall(function() return tostring(mw.language.new(lang):isRTL()) end)
mw.log("Warning: missing direction for language '" .. lang .. "', MediaWiki returns '" .. value .. "'")
end
end
-- utility: reverse order iterator on sequences
local function revipairs(t)
return function(t, i)
i = i - 1
local v = t[i]
if v == nil then return nil end
return i, v
end, t, #t + 1
end
-- Sort and deduplicate language code values (by scanning backward) for data cleanup
-- Also log languages having a direction mapping in this module but still not known by MediaWiki
table.sort(rtlLangs)
table.sort(ltrLangs)
for i, lang in revipairs(rtlLangs) do
if rtlLangs[i - 1] == rtlLangs[i] then table.remove(rtlLangs, i) end
if isKnownLang[lang] == nil then
mw.log("RTL language '" .. lang .. "' still not known by Mediawiki (could be a missing alias or variant)")
end
end
for i, lang in revipairs(ltrLangs) do
if ltrLangs[i - 1] == ltrLangs[i] then table.remove(ltrLangs, i) end
if isKnownLang[lang] == nil then
mw.log("LTR language '" .. lang .. "' still not known by Mediawiki (could be a missing alias or variant)")
end
end
-- Final presentation of current lists, sorted and deduplicated
mw.log("----")
mw.log("local rtlLangs = { '" .. table.concat(rtlLangs, "', '") .. "' }")
mw.log("local ltrLangs = { '" .. table.concat(ltrLangs, "', '") .. "' }")
return true
end }) --[==[ Enter this to run tests in the Lua console: =getmetatable(p).quickTests() --]==]
return p</text>
<sha1>n6dnippb8dl8nupbrxgqviac0hno50v</sha1>
</revision>
</page>
<page>
<title>Module:Dir/RTL overrides</title>
<ns>828</ns>
<id>95388411</id>
<revision>
<id>1223091335</id>
<timestamp>2020-07-03T04:07:06Z</timestamp>
<contributor>
<username>Amitie 10g</username>
<id>185006</id>
</contributor>
<comment>Created page with "local p = {} --[==[ Basic input sequences: relative order or duplicates does not matter here (but the end of the self test displays them sorted and deduplicated), but codes m..."</comment>
<origin>1223091335</origin>
<model>Scribunto</model>
<format>text/plain</format>
<text bytes="4566" sha1="cxld5o18iaxkhru8z4aje5lec04qed1" xml:space="preserve">local p = {}
--[==[ Basic input sequences: relative order or duplicates does not matter here (but the end of the self test displays them sorted and deduplicated), but codes must be valid and belong to only one of the two sequences).
Any missing language code will be checked with mw.language.new(code):isRTL(), which is costly in loaded resources (it can only check 20 languages at most including the content language) So it is best to map all languages that are the most likely to be used. --]==]
local rtlLangs = { 'aeb', 'aeb-arab', 'ar', 'arc', 'arq', 'ary', 'arz', 'azb', 'bcc', 'bgn', 'bqi', 'ckb', 'dv', 'fa', 'fa-af', 'glk', 'ha-arab', 'he', 'khw', 'kk-arab', 'kk-cn', 'ks-arab', 'ku-arab', 'lki', 'lrc', 'luz', 'mzn', 'nqo', 'ota', 'pnb', 'prd', 'ps', 'sd', 'sdh', 'skr', 'skr-arab', 'ug', 'ug-arab', 'ur', 'uz-arab', 'ydd', 'yi' }
local ltrLangs = { 'aa', 'ab', 'abs', 'ace', 'ady', 'ady-cyrl', 'aeb-latn', 'af', 'ak', 'aln', 'als', 'alt', 'am', 'ami', 'an', 'ang', 'anp', 'arn', 'as', 'ase', 'ast', 'atj', 'av', 'avk', 'awa', 'ay', 'az', 'ba', 'ban', 'bar', 'bat-smg', 'bbc', 'bbc-latn', 'bcl', 'be', 'be-tarask', 'be-x-old', 'bg', 'bh', 'bho', 'bi', 'bjn', 'bm', 'bn', 'bo', 'bpy', 'br', 'brh', 'bs', 'btm', 'bto', 'bu', 'bug', 'bxr', 'ca', 'cbk-zam', 'cdo', 'ce', 'ceb', 'ch', 'cho', 'chr', 'chy', 'co', 'cop', 'cps', 'cr', 'crh', 'crh-cyrl', 'crh-latn', 'cs', 'csb', 'cu', 'cv', 'cy', 'da', 'de', 'de-at', 'de-ch', 'de-formal', 'din', 'diq', 'dsb', 'dtp', 'dty', 'dz', 'ee', 'egl', 'el', 'eml', 'en', 'en-ca', 'en-gb', 'en-ie', 'en-us', 'eo', 'es', 'es-419', 'es-formal', 'et', 'eu', 'ext', 'ff', 'fi', 'fil', 'fit', 'fiu-vro', 'fj', 'fkv', 'fo', 'fr', 'frc', 'fro', 'frp', 'frr', 'fur', 'fy', 'ga', 'gag', 'gan', 'gan-hans', 'gan-hant', 'gcf', 'gcr', 'gd', 'gl', 'gn', 'gom', 'gom-deva', 'gom-latn', 'gor', 'got', 'grc', 'gsw', 'gu', 'gv', 'ha', 'hak', 'haw', 'hi', 'hif', 'hif-deva', 'hif-latn', 'hil', 'hmn', 'ho', 'hr', 'hrx', 'hsb', 'ht', 'hu', 'hu-formal', 'hy', 'hyw', 'hz', 'ia', 'id', 'ie', 'ig', 'ii', 'ik', 'ike-cans', 'ike-latn', 'ilo', 'inh', 'io', 'is', 'it', 'iu', 'ja', 'jam', 'jbo', 'jut', 'jv', 'ka', 'kaa', 'kab', 'kbd', 'kbd-cyrl', 'kbd-latn', 'kbp', 'kea', 'kg', 'ki', 'kiu', 'kj', 'kjp', 'kk', 'kk-cyrl', 'kk-kz', 'kk-latn', 'kk-tr', 'kl', 'km', 'kn', 'ko', 'ko-kp', 'ko-kr', 'koi', 'kr', 'krc', 'kri', 'krj', 'krl', 'ks', 'ks-deva', 'ksh', 'ku', 'ku-latn', 'kum', 'kv', 'kw', 'ky', 'la', 'lad', 'lb', 'lbe', 'lez', 'lfn', 'lg', 'li', 'lij', 'liv', 'lld', 'lmo', 'ln', 'lo', 'loz', 'lt', 'ltg', 'lus', 'lv', 'lzh', 'lzz', 'mai', 'map-bms', 'mdf', 'mg', 'mh', 'mhr', 'mi', 'min', 'mk', 'ml', 'mn', 'mni', 'mnw', 'mo', 'mr', 'mrj', 'ms', 'mt', 'mus', 'mwl', 'my', 'myv', 'na', 'nah', 'nan', 'nap', 'nb', 'nds', 'nds-nl', 'ne', 'new', 'ng', 'niu', 'nl', 'nl-informal', 'nn', 'no', 'nod', 'non', 'nov', 'nrf', 'nrf-fr', 'nrf-gg', 'nrf-je', 'nrm', 'nso', 'nv', 'ny', 'nys', 'oc', 'olo', 'om', 'or', 'os', 'pa', 'pag', 'pam', 'pap', 'pcd', 'pdc', 'pdt', 'pfl', 'pi', 'pih', 'pl', 'pms', 'pnt', 'prg', 'pt', 'pt-br', 'pt-cv', 'pt-pt', 'qu', 'quc', 'qug', 'rgn', 'rif', 'rm', 'rmf', 'rmy', 'rn', 'ro', 'roa-rup', 'roa-tara', 'ru', 'rue', 'rup', 'ruq', 'ruq-cyrl', 'ruq-latn', 'rw', 'rwr', 'sa', 'sah', 'sat', 'sc', 'scd', 'scn', 'sco', 'sdc', 'se', 'sei', 'ses', 'sg', 'sgs', 'sh', 'sh-cyrl', 'sh-latn', 'shi', 'shi-latn', 'shi-tfng', 'shn', 'shy-latn', 'si', 'simple', 'sjd', 'sje', 'sju', 'sk', 'sl', 'sli', 'sm', 'sma', 'smj', 'smn', 'sms', 'sn', 'so', 'sq', 'sr', 'sr-cyrl', 'sr-ec', 'sr-el', 'sr-latn', 'srn', 'srq', 'ss', 'st', 'stq', 'sty', 'su', 'sv', 'sw', 'szl', 'szy', 'ta', 'tay', 'tcy', 'te', 'tet', 'tg', 'tg-cyrl', 'tg-latn', 'th', 'ti', 'tk', 'tl', 'tly', 'tn', 'to', 'tokipona', 'tpi', 'tr', 'tru', 'trv', 'ts', 'tt', 'tt-cyrl', 'tt-latn', 'tum', 'tw', 'ty', 'tyv', 'tzl', 'tzm', 'udm', 'ug-latn', 'uk', 'uz', 'uz-cyrl', 'uz-latn', 've', 'vec', 'vep', 'vi', 'vls', 'vmf', 'vo', 'vot', 'vro', 'wa', 'war', 'wo', 'wuu', 'xal', 'xh', 'xmf', 'xsy', 'yo', 'yue', 'za', 'zea', 'zgh', 'zh', 'zh-classical', 'zh-cn', 'zh-hans', 'zh-hant', 'zh-hk', 'zh-min-nan', 'zh-mo', 'zh-my', 'zh-sg', 'zh-tw', 'zh-wuu', 'zh-yue', 'zu' }
-- Build the inverted map of languages to direction returned by this data module (fast, but collisions are not checked: run the test module) for _, lang in ipairs(rtlLangs) do p[lang] = true end for _, lang in ipairs(ltrLangs) do p[lang] = false end
-- Also store the two lists (at boolean indice), used by the test module to check the inverted map p[true] = rtlLangs p[false] = ltrLangs
return p</text>
<sha1>cxld5o18iaxkhru8z4aje5lec04qed1</sha1>
</revision>
</page>
<page>
<title>Template:SPARQLText</title>
<ns>10</ns>
<id>23033014</id>
<revision>
<id>1399250943</id>
<parentid>1399250772</parentid>
<timestamp>2021-04-10T14:44:00Z</timestamp>
<contributor>
<ip>87.126.92.234</ip>
</contributor>
<comment>Undid revision 1399250772 by 87.126.92.234 (talk)</comment>
<origin>1399250943</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="340" sha1="f35rnwtdn4sdogbp73jb3irfk0cvqp7" xml:space="preserve">{{#if:|
Template:IfTemplate:IfTemplate:IfTemplate:If }}3<noinclude>Template:Doc</noinclude></text>
<sha1>f35rnwtdn4sdogbp73jb3irfk0cvqp7</sha1>
</revision>
</page>
<page>
<title>Template:Int try it</title>
<ns>10</ns>
<id>109708780</id>
<redirect title="Template:Int run it" />
<revision>
<id>1764769125</id>
<timestamp>2022-11-04T21:44:15Z</timestamp>
<contributor>
<username>عُثمان</username>
<id>5050751</id>
</contributor>
<comment>عُثمان moved page Template:Int try it to Template:Int run it: the recent change to run it seems fine, but I was confused about where to find the template since the name did not match - move is inaccordance; redirects should resolve</comment>
<origin>1764769125</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="33" sha1="jwzw36nb8jui2zuk88ncwnse88o65qy" xml:space="preserve">#REDIRECT Template:Int run it</text>
<sha1>jwzw36nb8jui2zuk88ncwnse88o65qy</sha1>
</revision>
</page>
<page>
<title>Module:SPARQLMentions</title>
<ns>828</ns>
<id>28161729</id>
<revision>
<id>1453690994</id>
<parentid>661638891</parentid>
<timestamp>2021-07-04T13:54:47Z</timestamp>
<contributor>
<username>Azertus</username>
<id>1229135</id>
</contributor>
<comment>add getTitle</comment>
<origin>1453690994</origin>
<model>Scribunto</model>
<format>text/plain</format>
<text bytes="2760" sha1="lahzcbsmcekjpuk5o23yy8vvav8qfnz" xml:space="preserve">local p = {}
-- Return the label of a given data item, formatted for linking local function getLabel(frame, id, prefix) if prefix == nil then prefix = end if id == "defaultView:BubbleChart" then id = "Q24515280" end if id == "defaultView:Graph" then id = "Q24515287" end if id == "defaultView:Map" then id = "Q24515275" end
if id == "defaultView:ImageGrid" then id = "Q24515278" end
if id == "wikibase:box" then id = "Q26211169" end if id == "wikibase:cornerWest" then id = "Q26211177" end label = mw.wikibase.label( id ) if label == nil then linktext = id extra = else linktext = label .. " (" .. id .. ")" extra = ' ' .. frame:expandTemplate({ title="Reasonator", args= { [1] = id}}) .. ' ' .. frame:expandTemplate({ title="SQID", args= { [1] = id}}) end
link = mw.wikibase.getEntityUrl( id )
return '[' .. link .. ' ' .. linktext .. ']' .. extra; end
local function map(func, array)
local new_array = {}
for i,v in ipairs(array) do
new_array[i] = func(v)
end
return new_array
end
local function getAll(text, regexp, seen, items) if items == nil then items = {} end if seen == nil then seen = {} end for item in string.gmatch(text, regexp) do if seen[item] == nil then seen[item] = 1 table.insert(items, item) end end return items end
-- Produce list of items mentioned in the query
function p.getItems(frame)
if not mw.wikibase then
return "no mw.wikibase"
end
items = getAll(frame.args[1], 'wd:(Q%d+)') return table.concat(map(function(it) return getLabel(frame, it) end, items), ", ") end
-- Produce list of properties mentioned in the query function p.getProperties(frame) if not mw.wikibase then return "no mw.wikibase" end
seen = {} items = {} prefixes = {'wdt', 'p', 'ps', 'pr', 'pq', 'psv', 'pv', 'prv', 'pqv', 'wdtn', 'psn', 'pqn', 'prn', 'wdno' } for _, pr in ipairs(prefixes) do items = getAll(frame.args[1], pr .. ':(P%d+)', seen, items) end return table.concat(map(function(it) return getLabel(frame, it, 'Property:') end, items), ", ") end
function p.getFunctions(frame) if not mw.wikibase then return "no mw.wikibase" end
seen = {} items = {} func = {'defaultView:BubbleChart', 'defaultView:Graph', 'defaultView:Map', 'defaultView:ImageGrid', 'wikibase:box', "wikibase:cornerWest" } for _, pr in ipairs(func) do items = getAll(frame.args[1], pr, seen, items) end return table.concat(map(function(it) return getLabel(frame, it) end, items), ", ") end
function p.getTitle(frame) if not mw.wikibase then return "no mw.wikibase" end
for line in string.gmatch(frame.args[1], "[^%c]+%c?") do local title = string.match(line, '^#title:%s*([^%c]+)')
if not (title == nil) then return title end end end
return p</text>
<sha1>lahzcbsmcekjpuk5o23yy8vvav8qfnz</sha1>
</revision>
</page>
<page>
<title>Template:SQID</title>
<ns>10</ns>
<id>26259378</id>
<revision>
<id>1233859301</id>
<parentid>1227690908</parentid>
<timestamp>2020-07-18T14:13:28Z</timestamp>
<contributor>
<username>MisterSynergy</username>
<id>44949</id>
</contributor>
<comment>move URL to https://sqid.toolforge.org</comment>
<origin>1233859301</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="993" sha1="j6wq5aq6l7wsi92xtysclan6m8dprov" xml:space="preserve"><!--
-->{{#if: | Template:Q  }}<!-- -->{{#if: | Template:P  }}<!-- -->{{#if: | <span class="plainlinks">[https://sqid.toolforge.org/#{{#if:
| /view?id={{#if:
|
| {{#if:
| Q{{#titleparts:}}
| P{{#titleparts:}}
}}
}}&lang=⧼Lang⧽
| /?lang=⧼Lang⧽
}} ]</span>
}}<!-- --><nowiki/>?lang=⧼Lang⧽ }}<!-- --><noinclude>Template:Documentation</noinclude></text>
<sha1>j6wq5aq6l7wsi92xtysclan6m8dprov</sha1>
</revision>
</page>
<page>
<title>Template:Reasonator</title>
<ns>10</ns>
<id>17365939</id>
<revision>
<id>1556587517</id>
<parentid>1507464031</parentid>
<timestamp>2022-01-05T12:35:07Z</timestamp>
<contributor>
<username>Venca24</username>
<id>103280</id>
</contributor>
<comment>+ cs, eo</comment>
<origin>1556587517</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="882" sha1="ej9pd5v5fuipsemxo8gx8dbsqgg5vij" xml:space="preserve">{{#if:
| <span class="plainlinks">[2]</span> }} Template:TranslateThis<noinclude>Template:Documentation</noinclude></text>
<sha1>ej9pd5v5fuipsemxo8gx8dbsqgg5vij</sha1>
</revision>
</page>
<page>
<title>Template:WikiProject</title>
<ns>10</ns>
<id>21790485</id>
<revision>
<id>2298079997</id>
<parentid>2053606357</parentid>
<timestamp>2025-01-14T09:49:46Z</timestamp>
<contributor>
<username>Mormegil</username>
<id>28758</id>
</contributor>
<comment>+cs</comment>
<origin>2298079997</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="2446" sha1="afrxihplnkiijrydcgi7kwzg00a84sv" xml:space="preserve"><noinclude>Template:Doc</noinclude><!--
-->{{#ifexist: Wikidata:WikiProject <!--
#then:
-->|{{#if:<!--
#then:
-->|Template:Section link<!--
#else:
-->|Template:Ll<!--
-->}}<!--
#else:
-->|{{error<!--
-->|Template:TranslateThis<!--
-->}}<!--
--> <small>Template:TranslateThis<!--
--></small><!--
-->}}</text>
<sha1>afrxihplnkiijrydcgi7kwzg00a84sv</sha1>
</revision>
</page>
<page>
<title>Template:WikiProject/pagename</title>
<ns>10</ns>
<id>22491841</id>
<revision>
<id>1294585707</id>
<parentid>238479307</parentid>
<timestamp>2020-10-19T21:05:53Z</timestamp>
<contributor>
<username>Tacsipacsi</username>
<id>33956</id>
</contributor>
<comment>substitute template that doesn’t do what its name suggests and what it does in other projects</comment>
<origin>1294585707</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="60" sha1="8o2k69wu2sme8f490aakwi7ynj63jjv" xml:space="preserve">{{#if:|Wikidata Talk|Wikidata}}:WikiProject {{{1}}}</text>
<sha1>8o2k69wu2sme8f490aakwi7ynj63jjv</sha1>
</revision>
</page>
<page>
<title>Template:ItemOrNot</title>
<ns>10</ns>
<id>28161695</id>
<revision>
<id>361346548</id>
<parentid>361300782</parentid>
<timestamp>2016-08-02T21:22:10Z</timestamp>
<contributor>
<username>Smalyshev (WMF)</username>
<id>1482806</id>
</contributor>
<origin>361346548</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="384" sha1="230nkvb4w9pmw09vu3optxajqkjdr42" xml:space="preserve">{{#if: | * {{{1}}}: | }}<noinclude>
<templatedata> { "params": { "1": { "label": "List item name", "type": "string", "required": true }, "2": { "description": "List item contents", "type": "string" } }, "description": "Displays list item if second argument is not empty, otherwise nothing", "format": "block" } </templatedata> </noinclude></text>
<sha1>230nkvb4w9pmw09vu3optxajqkjdr42</sha1>
</revision>
</page>
<page>
<title>Template:Int Properties</title>
<ns>10</ns>
<id>25945270</id>
<revision>
<id>360948553</id>
<parentid>360948486</parentid>
<timestamp>2016-07-31T15:39:37Z</timestamp>
<contributor>
<username>Airon90</username>
<id>4782</id>
</contributor>
<origin>360948553</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="63" sha1="1f6bvc59pk8lngjngkff5ej07hrd17a" xml:space="preserve"><noinclude>Template:Doc</noinclude>Template:Capitalize</text>
<sha1>1f6bvc59pk8lngjngkff5ej07hrd17a</sha1>
</revision>
</page>
<page>
<title>Template:Int properties</title>
<ns>10</ns>
<id>25941214</id>
<revision>
<id>2504115378</id>
<parentid>2438818739</parentid>
<timestamp>2026-06-10T11:28:12Z</timestamp>
<contributor>
<username>مواطن تونسي</username>
<id>1537128</id>
</contributor>
<minor/>
<comment>traduction ar</comment>
<origin>2504115378</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="746" sha1="ao6colplfei84pspf07jmngpp7arssr" xml:space="preserve"><noinclude>Template:Doc</noinclude>Template:TranslateThis</text>
<sha1>ao6colplfei84pspf07jmngpp7arssr</sha1>
</revision>
</page>
<page>
<title>Template:SPARQL2/doc</title>
<ns>10</ns>
<id>35750675</id>
<revision>
<id>1425856775</id>
<parentid>1425856600</parentid>
<timestamp>2021-05-21T17:39:04Z</timestamp>
<contributor>
<username>PAC2</username>
<id>4892</id>
</contributor>
<comment>/* See also */ typo</comment>
<origin>1425856775</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="533" sha1="p2irk8qhdq7sqdc2n9kyjs3lvi2j5kw" xml:space="preserve"><nowiki>Template loop detected: Template:SPARQL2</nowiki>
Template loop detected: Template:SPARQL2
<nowiki>Template loop detected: Template:SPARQL2</nowiki>
Template loop detected: Template:SPARQL2
<nowiki>Template loop detected: Template:SPARQL2</nowiki>
Template loop detected: Template:SPARQL2
<nowiki>Template loop detected: Template:SPARQL2</nowiki>
Template loop detected: Template:SPARQL2
See also
<sha1>p2irk8qhdq7sqdc2n9kyjs3lvi2j5kw</sha1>
</revision>
</page>
<page>
<title>Template:Int run it</title>
<ns>10</ns>
<id>25022557</id>
<revision>
<id>2438820809</id>
<parentid>2033139854</parentid>
<timestamp>2025-12-06T14:46:20Z</timestamp>
<contributor>
<username>YeBoy371</username>
<id>2200680</id>
</contributor>
<origin>2438820809</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="1085" sha1="8ggotttekjqxrksv8jgpqj8yv3lzvla" xml:space="preserve"><noinclude>Template:Doc</noinclude>Template:TranslateThis</text>
<sha1>8ggotttekjqxrksv8jgpqj8yv3lzvla</sha1>
</revision>
</page>
</mediawiki></nowiki>
<mediawiki xmlns="http://www.mediawiki.org/xml/export-0.11/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.11/ http://www.mediawiki.org/xml/export-0.11.xsd" version="0.11" xml:lang="en">
<siteinfo> <sitename>Wikidata</sitename> <dbname>wikidatawiki</dbname> <base>https://www.wikidata.org/wiki/Wikidata:Main_Page</base> <generator>MediaWiki 1.47.0-wmf.17</generator> <case>first-letter</case> <namespaces> <namespace key="-2" case="first-letter">Media</namespace> <namespace key="-1" case="first-letter">Special</namespace> <namespace key="0" case="first-letter" /> <namespace key="1" case="first-letter">Talk</namespace> <namespace key="2" case="first-letter">User</namespace> <namespace key="3" case="first-letter">User talk</namespace> <namespace key="4" case="first-letter">Wikidata</namespace> <namespace key="5" case="first-letter">Wikidata talk</namespace> <namespace key="6" case="first-letter">File</namespace> <namespace key="7" case="first-letter">File talk</namespace> <namespace key="8" case="first-letter">MediaWiki</namespace> <namespace key="9" case="first-letter">MediaWiki talk</namespace> <namespace key="10" case="first-letter">Template</namespace> <namespace key="11" case="first-letter">Template talk</namespace> <namespace key="12" case="first-letter">Help</namespace> <namespace key="13" case="first-letter">Help talk</namespace> <namespace key="14" case="first-letter">Category</namespace> <namespace key="15" case="first-letter">Category talk</namespace> <namespace key="120" case="first-letter">Property</namespace> <namespace key="121" case="first-letter">Property talk</namespace> <namespace key="122" case="first-letter">Query</namespace> <namespace key="123" case="first-letter">Query talk</namespace> <namespace key="146" case="first-letter">Lexeme</namespace> <namespace key="147" case="first-letter">Lexeme talk</namespace> <namespace key="640" case="first-letter">EntitySchema</namespace> <namespace key="641" case="first-letter">EntitySchema talk</namespace> <namespace key="710" case="first-letter">TimedText</namespace> <namespace key="711" case="first-letter">TimedText talk</namespace> <namespace key="828" case="first-letter">Module</namespace> <namespace key="829" case="first-letter">Module talk</namespace> <namespace key="1198" case="first-letter">Translations</namespace> <namespace key="1199" case="first-letter">Translations talk</namespace> <namespace key="1728" case="first-letter">Event</namespace> <namespace key="1729" case="first-letter">Event talk</namespace> <namespace key="2600" case="first-letter">Topic</namespace> </namespaces> </siteinfo> <page> <title>Template:SPARQL2</title> <ns>10</ns> <id>28161690</id> <revision> <id>2346047691</id> <parentid>2346040648</parentid> <timestamp>2025-05-08T12:02:25Z</timestamp> <contributor> <username>Madamebiblio</username> <id>2952832</id> </contributor> <minor/> <comment>Reverted edits by 201.143.205.181 (talk) to last revision by Kokage si</comment> <origin>2294596805</origin> <model>wikitext</model> <format>text/x-wiki</format> <text bytes="7567" sha1="s4975lvx7s2i4pjji1govtxccu2rt3e" xml:space="preserve">Template:SPARQL2/doc
<onlyinclude>Template:Clear{{#ifeq:|{{{nohints}}}| <!--hidden hints--> | {{TranslateThis<!--
-->|ar=يستخدم الاستعلام التالي هذه:<!--
-->|be-tarask=Дадзены запыт выкарыстоўвае:<!--
-->|cs=Následující dotaz používá:<!--
-->|de=Die Suchanfrage verwendet:<!--
-->|en=The following query uses these:<!--
-->|en-gb=The following query uses these:<!--
-->|el=Το ακόλουθο ερώτημα χρησιμοποιεί αυτά:<!--
-->|es=La siguiente consulta utiliza lo siguiente:<!--
-->|fi=Seuraava kysely käyttää näitä:<!--
-->|fr=La requête suivante utilise ces :<!--
-->|hu=Ez a lekérdezés a következőket használja:<!--
-->|id=Kueri di bawah akan menggunakan entitas berikut:<!--
-->|it=La seguente query utilizza questi:<!--
-->|ja=以下のクエリではこれらを使用します:<!--
-->|nl=Deze query gebruikt:<!--
-->|pl=To zapytanie używa:<!--
-->|pt=A consulta seguinte utiliza estes:<!--
-->|pt-br=A consulta seguinte utiliza estes:<!--
-->|ru=Этот запрос использует:<!--
-->|sv=Följande fråga använder dessa:<!--
-->|tr=Aşağıdaki sorgu bunları kullanıyor:<!--
-->|uk=Цей запит використовує:<!--
-->}}<!-- -->Template:ItemOrNot <!-- -->Template:ItemOrNot <!-- -->Template:ItemOrNot <!--
-->}}
[[:Template:SPARQLText]]
<!-- --><div class="displayonly">{{#if: ||Template:Int try it}}</div>Template:Clear</onlyinclude><noinclude> <templatedata> { "params": { "query": { "required": true, "label": { "ar": "استعلام", "be-tarask": "запыт", "cs": "dotaz", "en": "query", "es": "consulta", "fr": "requête", "id": "kueri", "it": "query", "ja": "クエリ", "pl": "zapytanie", "pt": "consulta", "pt-br": "consulta", "sv": "fråga",
"tr": "sorgu",
"uk": "запит" }, "description": { "ar": "استعلام سباركل", "be-tarask": "запыт SPARQL", "cs": "SPARQL dotaz", "en": "SPARQL query", "es": "consulta SPARQL", "fr": "la requête que le modèle doit traiter et afficher", "id": "kueri SPARQL", "it": "query SPARQL", "ja": "SPARQLクエリ", "pl": "query SPARQL", "pt": "consulta SPARQL", "pt-br": "consulta SPARQL", "sv": "SPARQL fråga", "tr": "SPARQL sorgusu", "uk": "запит SPARQL" }, "example": { "be-tarask": "SELECT * WHERE { ?x wdt:P31 wd:Q5 } LIMIT 1", "cs": "SELECT * WHERE { ?x wdt:P31 wd:Q5 } LIMIT 1", "en": "SELECT * WHERE { ?x wdt:P31 wd:Q5 } LIMIT 1", "es": "SELECT ?item WHERE { ?item wdt:P31 wd:Q5 } LIMIT 1", "fr": "select ?item where { ?item wdt:P31 wd:Q5 } LIMIT 1", "id": "SELECT * WHERE { ?a wdt:P31 wd:Q5 } LIMIT 1", "it": "select ?item where { ?item wdt:P31 wd:Q5 } LIMIT 1", "pt": "select ?item where { ?item wdt:P31 wd:Q5 } LIMIT 1", "pt-br": "select ?item where { ?item wdt:P31 wd:Q5 } LIMIT 1" }, "type": "string", "aliases": [ "sparql" ], "suggested": true }, "extraprefix": { "description": { "ar": "بادئات إضافية لإضافتها",
"be-tarask": "дадатковыя прэфіксы (неабавязковыя)",
"cs": "Dodatečné prefixy (volitelné)", "en": "Extra prefixes to be added", "es": "Prefijos extra a añadir (opcional)", "fr": "les préfixes SPARQL non standards ou inconnus du service de requête éventuellement nécessaires (optionnel)", "id": "Prefiks SPARQL yang akan ditambahkan", "it": "Aggiungere i prefissi SPARQL non standard o sconosciuti eventualmente necessari (opzionale)", "ja": "追加する接頭辞(オプション)", "pl": "Dodatkowe prefiksy (opcjonalnie)", "pt": "Adicionar os prefixos SPARQL não padrões ou desconhecidos eventualmente necessários (opcional)", "pt-br": "Adicionar os prefixos SPARQL não padrões ou desconhecidos eventualmente necessários (opcional)", "uk": "Додаткові префікси (необов'язкові)" }, "example": "PREFIX wikibase: <http://wikiba.se/ontology#>", "type": "string" } }, "description": {
"be-tarask": "Гэты шаблён выводзіць запыт SPARQL з падсьветкай сынтаксісу, выкарыстаных элемэнтаў і спасылак на WDQS дзеля запуску запыту. \nЗРАБІЦЬ: скарыстаныя меткі элемэнтаў не лякалізаваныя",
"cs": "Tato šablona zobrazuje SPARQL dotaz ze zvýrazněnou syntaxí, použité položky a odkaz na WDQS dotazovací službu pro vyzkoušení.", "en": "This template displays SPARQL query with syntax highlighting, used items and link to WDQS query site to run the query. \nTODO: used items labels are not localized", "es": "Esta plantilla muestra una consulta SPARQL con resaltado de sintaxis, los items utilizados y un enlace al WDQS para lanzar la consulta", "fr": "Ce modèle affiche une requête SPARQL et permet de la lancer au travers du service de requête Wikidata. Il affiche aussi quelques informations basiques sur les éléments et fonctionnalités utilisées par cette requête", "id": "Templat ini menampilkan kueri SPARQL dengan pembedaan warna pada sintaks beserta entitas Wikidata yang digunakan dan pranala kueri di WDQS.", "it": "Questo template mostra una query SPARQL evidenziandone la sintassi e gli elementi usati e fornisce un link alla query WDQS site che permette di lanciare la query", "ja": "このテンプレートは構文強調付きのSPARQLクエリ、使用した項目、クエリを実行するWDQSクエリサイトへのリンクを表示します。", "pl": "Szablon wyświetla zapytanie SPARQL z podświetlaniem składni, listą użytych elementów i linkiem do WDQS.", "pt": "Esta predefinição mostra uma consulta SPARQL na qual evidencia a sintaxe e os elementos usados e fornece um enlace ao site WDQS que permite executar a consulta", "pt-br": "Esta predefinição mostra uma consulta SPARQL na qual evidencia a sintaxe e os elementos usados e fornece um enlace ao site WDQS que permite executar a consulta", "sv": "Denna mall visar en SPARQL fråga med syntaxfärgning, använda objekt och länk till WDQS frågesajten för att köra frågan. \nTODO: använda objekts etiketter är inte lokaliserade", "uk": "Цей шаблон показує запит SPARQL з підсвічуванням елементів синтаксису, список використаних елементів і посилання на сайт WDQS-запиту." }, "paramOrder": [ "query", "extraprefix" ], "format": "block" } </templatedata> </noinclude></text>
<sha1>s4975lvx7s2i4pjji1govtxccu2rt3e</sha1>
</revision>
</page>
<page>
<title>Template:Template</title>
<ns>10</ns>
<id>12414</id>
<redirect title="Template:Tl" />
<revision>
<id>431881</id>
<parentid>312894</parentid>
<timestamp>2012-11-13T02:07:50Z</timestamp>
<contributor>
<username>~riley</username>
<id>2219</id>
</contributor>
<comment>http://en.wikipedia.org/w/index.php?title=Template:Template&action=edit</comment>
<origin>431881</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="25" sha1="cdpzj9yp99pn5v093b404f4sc7cybv1" xml:space="preserve">#REDIRECT Template:Tl</text>
<sha1>cdpzj9yp99pn5v093b404f4sc7cybv1</sha1>
</revision>
</page>
<page>
<title>Template:Tl</title>
<ns>10</ns>
<id>3170</id>
<revision>
<id>2508986920</id>
<parentid>1946850712</parentid>
<timestamp>2026-06-22T01:25:21Z</timestamp>
<contributor>
<username>RogueScholar</username>
<id>3003918</id>
</contributor>
<minor/>
<comment>Format template code for readability and convert numeric HTML entities to named equivalents to accomplish the same</comment>
<origin>2508986920</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="1299" sha1="dqel96mgakegupz568kpnt91rdib9m4" xml:space="preserve"><includeonly><code>{{{{#if:|subst:}}<!-- Begin evaluation of first parameter.
-->{{#ifeq:{|:|:[[]]|<!-- If already prefixed by colon, show the link as such, too.
-->{{#switch:<!-- Target's namespace determines the link format. -->
| | Template = [[Template:|]]<!-- Main: (absent) or Template: namespaces -->
| File | Category = [[:{{{1}}}]]<!-- File and Category namespaces receive hidden colon prefix. -->
| #default = [[{{{1}}}]]<!-- All others are linked verbatim.
-->}}<!-- End of switch function. -->}}<!-- End of first parameter evaluation.
-->{{#ifeq: {{{2}}}| x||{{{2}}}}}<!--
-->{{#ifeq: {{{3}}}| x||{{{3}}}}}<!--
-->{{#ifeq: {{{4}}}| x||{{{4}}}}}<!--
-->{{#ifeq: {{{5}}}| x||{{{5}}}}}<!--
-->{{#ifeq: {{{6}}}| x||{{{6}}}}}<!--
-->{{#ifeq: {{{7}}}| x||{{{7}}}}}<!--
-->{{#ifeq: {{{8}}}| x||{{{8}}}}}<!--
-->{{#ifeq: {{{9}}}| x||{{{9}}}}}<!--
-->{{#ifeq:{{{10}}}|x||{{{10}}}}}}}</code></includeonly><noinclude>
Template:Documentation</noinclude></text>
<sha1>dqel96mgakegupz568kpnt91rdib9m4</sha1>
</revision>
</page>
<page>
<title>Template:Capitalize</title>
<ns>10</ns>
<id>24835143</id>
<revision>
<id>2283223741</id>
<parentid>2282968755</parentid>
<timestamp>2024-12-03T22:55:49Z</timestamp>
<contributor>
<username>Tacsipacsi</username>
<id>33956</id>
</contributor>
<comment>Undid revision 2282968755 by 2806:2F0:A080:F124:78E9:9300:6983:EA83 (talk): ???</comment>
<origin>2283223741</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="100" sha1="08bgnnmlolmwjwag381zkq615fl2s0a" xml:space="preserve"><includeonly>Script error: No such module "Capitalize".</includeonly><noinclude>
Template:Doc </noinclude></text>
<sha1>08bgnnmlolmwjwag381zkq615fl2s0a</sha1>
</revision>
</page>
<page>
<title>Template:Int items</title>
<ns>10</ns>
<id>28641837</id>
<revision>
<id>2438810545</id>
<parentid>2208740771</parentid>
<timestamp>2025-12-06T14:15:50Z</timestamp>
<contributor>
<username>YeBoy371</username>
<id>2200680</id>
</contributor>
<origin>2438810545</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="475" sha1="knyh87z85w0os01yxpmvrzvlnwf07fb" xml:space="preserve"><noinclude>Template:Doc</noinclude>Template:TranslateThis</text>
<sha1>knyh87z85w0os01yxpmvrzvlnwf07fb</sha1>
</revision>
</page>
<page>
<title>Module:Capitalize</title>
<ns>828</ns>
<id>25940912</id>
<revision>
<id>333880118</id>
<parentid>327538585</parentid>
<timestamp>2016-05-08T21:08:10Z</timestamp>
<contributor>
<username>TomT0m</username>
<id>7333</id>
</contributor>
<comment>cap after the tags</comment>
<origin>333880118</origin>
<model>Scribunto</model>
<format>text/plain</format>
<text bytes="518" sha1="oi3oo9q42s5okxrm5hbfy01zk32pehp" xml:space="preserve">
local p = {}
function p.cap(str) lang = mw.getContentLanguage() if lang:ucfirst(str) ~= str then return lang:ucfirst(str) else local substr = mw.ustring.sub b, e = mw.ustring.find(str, ">%s*%a") while e ~= nil do if mw.ustring.find(">", substr(str, b,e)) == nil then return substr(str, 1, e-1) .. lang:ucfirst(substr(str,e,e)) ..substr(str, e+1) end b, e = mw.ustring.find(str, ">%s*%a", e) end return str end end
function p.capitalize(frame) return p.cap(frame.args[1]) end
return p</text>
<sha1>oi3oo9q42s5okxrm5hbfy01zk32pehp</sha1>
</revision>
</page>
<page>
<title>Template:Clear</title>
<ns>10</ns>
<id>12131100</id>
<revision>
<id>665474881</id>
<parentid>91992232</parentid>
<timestamp>2018-04-14T18:59:12Z</timestamp>
<contributor>
<username>Dataeast0000001</username>
<id>2952466</id>
</contributor>
<comment>move onlyinclude to noinclude</comment>
<origin>665474881</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="79" sha1="5aa2j06l3n3husy1g6jggf6oznzocau" xml:space="preserve"><div style="clear:both;"></div><noinclude>Template:Documentation</noinclude></text>
<sha1>5aa2j06l3n3husy1g6jggf6oznzocau</sha1>
</revision>
</page>
<page>
<title>Module:Fallback</title>
<ns>828</ns>
<id>19181086</id>
<revision>
<id>714642825</id>
<parentid>714642495</parentid>
<timestamp>2018-07-23T16:35:03Z</timestamp>
<contributor>
<username>Matěj Suchánek</username>
<id>53613</id>
</contributor>
<minor/>
<comment>fix</comment>
<origin>714642825</origin>
<model>Scribunto</model>
<format>text/plain</format>
<text bytes="5559" sha1="6vr2in87podxnsj3x2jttt1r1qisf9q" xml:space="preserve">local p = {}
function p.fblist(lang, langonly) -- list the full fallback chain from a language to en local fbtable = mw.language.getFallbacksFor(lang) table.insert(fbtable, 1, lang) if not langonly then table.insert(fbtable, 'message') table.insert(fbtable, 'item') table.insert(fbtable, 'default') end return fbtable end
function p._langSwitch(args, lang) -- args: table of translations -- Return error if there is not default and no English version -- otherwise returns the message in the most appropriate, plus the lang code as a second value if not args.en and not args.default and not args.message and not args.item and args.nocat ~= '1' then return error("langSwitch error: no default") end -- get language (either stated one or user's default language) if not lang then return '<strong class="error">LangSwitch Error: no lang</strong>' -- must become proper error end -- get the list of acceptable language (lang + those in lang's fallback chain) and check their content for i, j in ipairs(p.fblist(lang)) do if args[j] then if args[j] == '~' then return nil, j end if j == 'item' then local label, lang = mw.wikibase.getLabelWithLang(args[j]) if label then return label, lang else return args[j], 'en' end end if j == 'message' then return tostring(mw.message.new(args[j]):inLanguage(lang)) end -- if this is an interface message if args[j] ~= then return args[j], j end end end return nil end
function p.langSwitch(frame) -- version to be used from wikitext local args = frame.args -- if no expected args provided than check parent template/module args if not args.en and not args.default and not args.nocat then args = frame:getParent().args end local lang if args.lang and args.lang ~= then lang = args.lang args.lang = nil else -- get user's chosen language lang = frame:preprocess( "⧼lang⧽" ) end local str, language = p._langSwitch(args, lang) return str -- get the first value of the langSwitch, (the text) not the second (the language) end
function p.fallbackpage(base, lang, formatting) local languages = p.fblist(lang) for i, lng in ipairs(languages) do if mw.title.new(base .. '/' .. lng).exists then if formatting == 'table' then return {base .. '/' .. lng, lng} -- returns name of the page + name of the language else return base .. '/' .. lng -- returns only the page end end end return base end
function p.autotranslate(frame) -- logic for template:Autotranslate local args = frame.args if not args.lang or args.lang == then args.lang = frame:preprocess( "⧼lang⧽" ) -- get user's chosen language end
-- find base page local base = args.base if not base or base == then return '<strong class="error">Base page not provided for autotranslate</strong>' end if string.sub(base, 2, 9) ~= 'emplate:' then base = 'Template:' .. base -- base provided without 'Template:' part end
-- find base template language subpage local page = p.fallbackpage(base, args.lang) -- if (not page and base ~= args.base) then -- try the original args.base string. This case is only needed if base is not in template namespace page = p.fallbackpage(args.base, args.lang) end if not page then return string.format('<strong class="error">no fallback page found for autotranslate (base=%s, lang=%s)</strong>', args.base, args.lang) end
-- repack args in a standard table local newargs = {} for field, value in pairs(args) do if field ~= 'base' then newargs[field] = value end end
-- Transclude Template:Page with template arguments the same as the ones passed to Template:Autotranslate template. return frame:expandTemplate{ title = page, args = newargs } end
function p.translate(page, key, lang) --translate data stored in a module if type(page) == 'string' then -- if the requested translation table is not yet loaded page = require('Module:' .. page) end
local val if page[key] then val = page[key] elseif page.keys and page.keys[key] then-- key 'keys" is an index of all keys, including redirects, see Module:i18n/datatype val = page.keys[key] end if not val then return '<' .. key .. '>' end return p._langSwitch(val, lang) end
function p.translatelua(frame) local lang = frame.args.lang local page = require('Module:' .. mw.text.trim(frame.args[1])) -- page should only contain a simple of translations if not lang or mw.text.trim(lang) == then lang = frame:preprocess( "⧼lang⧽" ) end if frame.args[2] then page = page[mw.text.trim(frame.args[2])] end return p._langSwitch(page, lang) end
function p.runTests() local toFallbackTest = require('Module:Fallback/tests/fallbacks') local result = true
mw.log('Testing fallback chains') for i, t in ipairs(toFallbackTest) do local fbtbl = table.concat(p.fblist(t.initial), ', ') local expected = table.concat(t.expected, ', ') local ret = (fbtbl == expected) mw.log(i, ret and 'passed' or 'FAILED', t.initial, (not ret) and ('FAILED\nis >>' .. fbtbl .. '<<\nbut should be >>' .. expected .. '<<\n') or ) result = result and ret end
return result end
function p.showTemplateArguments(frame) -- list all input arguments of the template that calls "Script error: No such module "Fallback"." local str = for name, value in pairs( frame:getParent().args ) do if str == then str = string.format('%s=%s', name, value) -- argument #1 else str = string.format('%s, %s=%s', str, name, value) -- the rest end end return str end
return p</text>
<sha1>6vr2in87podxnsj3x2jttt1r1qisf9q</sha1>
</revision>
</page>
<page>
<title>Template:Ll</title>
<ns>10</ns>
<id>3264473</id>
<revision>
<id>618665821</id>
<parentid>443393354</parentid>
<timestamp>2018-01-11T02:59:59Z</timestamp>
<contributor>
<username>Jarekt</username>
<id>1274</id>
</contributor>
<comment>Fulfilling edit request by User:Kaganer. Thanks for helping!</comment>
<origin>618665821</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="178" sha1="h8s4unutwk14jcbyfcq88r5yvqbu5x5" xml:space="preserve">[[Special:MyLanguage/{{{1}}}{{#if:|#{{{anchor}}}}}|Template:PDT</includeonly>]]<noinclude>
Template:Documentation </noinclude></text>
<sha1>h8s4unutwk14jcbyfcq88r5yvqbu5x5</sha1>
</revision>
</page>
<page>
<title>Template:TranslateThis</title>
<ns>10</ns>
<id>16552759</id>
<revision>
<id>483148362</id>
<parentid>483129342</parentid>
<timestamp>2017-05-08T01:54:31Z</timestamp>
<contributor>
<username>MKar</username>
<id>6110</id>
</contributor>
<minor/>
<comment>Undid revision 483129342 by 70.71.90.6 (talk)</comment>
<origin>483148362</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="97" sha1="rm4lztokzfib496c8sbt9q36vx6n9tz" xml:space="preserve"><includeonly>Script error: No such module "TranslateThis".</includeonly><noinclude>Template:Documentation</noinclude></text>
<sha1>rm4lztokzfib496c8sbt9q36vx6n9tz</sha1>
</revision>
</page>
<page>
<title>Module:TranslateThis</title>
<ns>828</ns>
<id>16552706</id>
<revision>
<id>2144500220</id>
<parentid>1980692436</parentid>
<timestamp>2024-05-04T13:29:50Z</timestamp>
<contributor>
<username>Uzume</username>
<id>11596</id>
</contributor>
<comment>switch frame:preprocess("⧼lang⧽") to callParserFunction("int", "lang")</comment>
<origin>2144500220</origin>
<model>Scribunto</model>
<format>text/plain</format>
<text bytes="1738" sha1="j2it1vjxk477pw54t7yheap3g9xt452" xml:space="preserve">local fb = require('Module:Fallback')
local dir = require('Module:Dir')
return { main = function( frame )
local function shallowcopy(orig) if type(orig) ~= 'table' then return orig end
local result = {} for key, value in pairs(orig) do result[key] = value end return result end
local args = shallowcopy(frame:getParent().args) local lang = args.lang or frame:callParserFunction("int", "lang") -- I don't know of any other way to get the user's language... args.lang = nil
local anchor = args.anchor args.anchor = nil if (anchor and args[anchor]) then anchor = args[anchor] end anchor = anchor and frame:expandTemplate( { title = "Anchor", args = { anchor } } ) or
local result = args[ lang ] if result and result ~= then result = '<span dir="' .. dir.select(lang, 'rtl', 'ltr') .. '" lang="' .. lang .. '">' .. result .. '</span>' else local default = {} for i, v in pairs( args ) do if v ~= "" then table.insert(default, '<span dir="' .. dir.select(i, 'rtl', 'ltr') .. '" lang="' .. i .. '">' .. v .. '</span> <small>(' .. i .. ')</small>') end end default = table.concat(default, ' / ') args.default=default local newlang result, newlang = fb._langSwitch(args, lang) if not newlang then result = elseif newlang~='default' then result = '<span dir="' .. dir.select(newlang, 'rtl', 'ltr') .. '" lang="' .. newlang .. '">' .. result .. '</span> <small>(' .. newlang .. ')</small>' end local langname = mw.language.fetchLanguageName( lang, lang ) if langname ~= "" and newlang then result = result .. " – " .. frame:expandTemplate( { title = "Help translate", args = { langname, lang = lang } } ) end end
return anchor .. result end}</text>
<sha1>j2it1vjxk477pw54t7yheap3g9xt452</sha1>
</revision>
</page>
<page>
<title>Module:Dir</title>
<ns>828</ns>
<id>95388294</id>
<revision>
<id>1935187194</id>
<parentid>1935159027</parentid>
<timestamp>2023-07-15T22:41:28Z</timestamp>
<contributor>
<username>Tacsipacsi</username>
<id>33956</id>
</contributor>
<comment>Undid revision 1935159027 by 177.232.91.83 (talk): test edit</comment>
<origin>1935187194</origin>
<model>Scribunto</model>
<format>text/plain</format>
<text bytes="5612" sha1="n6dnippb8dl8nupbrxgqviac0hno50v" xml:space="preserve">-- This module implements Template:Dir.
-- local rtlOverrides = mw.loadData('Module:Dir/RTL overrides') -- !!! mw.loadData() is currently broken, it does NOT load anything local rtlOverrides = require('Module:Dir/RTL overrides') local p = {}
local function trim(s)
if s and s ~= then s = tostring(s):match('^%s*(.-)%s*$') end
if s == then return nil end
return s
end
function p.rtlLangs(isRTL)
if isRTL == nil then isRTL = true end
return rtlOverrides[isRTL] or {}
end
function p.isRTL(code)
if type(code) ~= 'string' then return nil end
local v = rtlOverrides[code] -- very fast and not limited in the number of supported languages
if v ~= nil then return v end -- return it if mapped, otherwise use MediaWiki library:
local success, ret = pcall(function ()
return mw.language.new(code):isRTL() -- expensive and limited to 20 languages per MediaWiki instance
end)
return success and ret
end
function p.select(code, rtl, ltr)
if p.isRTL(code) then
return rtl
else
return ltr
end
end
-- Used via a template Template:Dir -- which just calls Script error: No such module "Dir"., the 3 parameters are automatically trimmed: -- Parameter 1 takes the default value from ⧼Lang⧽ if it's empty or not specified. -- Parameter 2 can be named rtl, may be explicitly empty, otherwise takes the default value 'rtl' only if it's not specified. -- Parameter 3 can be named ltr, may be explicitly empty, otherwise takes the default value 'ltr' only if it's not specified. function p.main(frame)
local args = frame:getParent().args -- Parameters used to transclude Template:Dir
local code = trim(args[1]) or frame:callParserFunction('Int', 'Lang')
local rtl = trim(args.rtl or args[2] or 'rtl')
local ltr = trim(args.ltr or args[3] or 'ltr')
return p.select(code, rtl, ltr)
end
setmetatable(p, { quickTests = function ()
local rtlLangs = p.rtlLangs(true) local ltrLangs = p.rtlLangs(false)
-- Basic check of data format
local function checkLangs(name, langs)
for k, lang in pairs(langs) do
assert(type(k) == 'number' and k == math.floor(k)
and type(lang) == 'string' and #lang >= 2 and #lang <= 16
and lang:find('^[a-z][%-0-9a-z]*[0-9a-z]$') == 1,
": Invalid sequence of language codes, " .. name .. "['" .. k .. "'] = '" .. lang .. "'")
end
return true
end
local ok, msg
ok, msg = pcall(checkLangs, 'rtlLangs', rtlLangs)
if not ok then return false, msg end
ok, msg = pcall(checkLangs, 'ltrLangs', ltrLangs)
if not ok then return false, msg end
-- Build inverse maps of languages having each direction
local isrtl, isltr = {}, {}
for _, lang in ipairs(rtlLangs) do isrtl[lang] = true end
for _, lang in ipairs(ltrLangs) do isltr[lang] = true end
-- Check conflicts using the two inverse maps
for _, lang in ipairs(rtlLangs) do
if isltr[lang] then return false, ": Direction conflict for '" .. lang .. "'" end
end
for _, lang in ipairs(ltrLangs) do
if isrtl[lang] then return false, ": Direction conflict for '" .. lang .. "'" end
end
-- Log missing languages (allows filling the tables above) according to MediaWiki internal data
local knownLangs, isKnownLang = mw.language.fetchLanguageNames(), {}
for lang, _ in pairs(knownLangs) do
isKnownLang[lang] = true
if rtlOverrides[lang] == nil then -- only if we still don't have data for this language
-- Note: we cannot check more than 20 languages at once, then MediaWiki raises an error.
-- So this test only runs on the Lua console, where you can update the tables at top.
-- This also means we cannot compare what MediaWiki returns with the direction we map here for all languages.
ok, value = pcall(function() return tostring(mw.language.new(lang):isRTL()) end)
mw.log("Warning: missing direction for language '" .. lang .. "', MediaWiki returns '" .. value .. "'")
end
end
-- utility: reverse order iterator on sequences
local function revipairs(t)
return function(t, i)
i = i - 1
local v = t[i]
if v == nil then return nil end
return i, v
end, t, #t + 1
end
-- Sort and deduplicate language code values (by scanning backward) for data cleanup
-- Also log languages having a direction mapping in this module but still not known by MediaWiki
table.sort(rtlLangs)
table.sort(ltrLangs)
for i, lang in revipairs(rtlLangs) do
if rtlLangs[i - 1] == rtlLangs[i] then table.remove(rtlLangs, i) end
if isKnownLang[lang] == nil then
mw.log("RTL language '" .. lang .. "' still not known by Mediawiki (could be a missing alias or variant)")
end
end
for i, lang in revipairs(ltrLangs) do
if ltrLangs[i - 1] == ltrLangs[i] then table.remove(ltrLangs, i) end
if isKnownLang[lang] == nil then
mw.log("LTR language '" .. lang .. "' still not known by Mediawiki (could be a missing alias or variant)")
end
end
-- Final presentation of current lists, sorted and deduplicated
mw.log("----")
mw.log("local rtlLangs = { '" .. table.concat(rtlLangs, "', '") .. "' }")
mw.log("local ltrLangs = { '" .. table.concat(ltrLangs, "', '") .. "' }")
return true
end }) --[==[ Enter this to run tests in the Lua console: =getmetatable(p).quickTests() --]==]
return p</text>
<sha1>n6dnippb8dl8nupbrxgqviac0hno50v</sha1>
</revision>
</page>
<page>
<title>Module:Dir/RTL overrides</title>
<ns>828</ns>
<id>95388411</id>
<revision>
<id>1223091335</id>
<timestamp>2020-07-03T04:07:06Z</timestamp>
<contributor>
<username>Amitie 10g</username>
<id>185006</id>
</contributor>
<comment>Created page with "local p = {} --[==[ Basic input sequences: relative order or duplicates does not matter here (but the end of the self test displays them sorted and deduplicated), but codes m..."</comment>
<origin>1223091335</origin>
<model>Scribunto</model>
<format>text/plain</format>
<text bytes="4566" sha1="cxld5o18iaxkhru8z4aje5lec04qed1" xml:space="preserve">local p = {}
--[==[ Basic input sequences: relative order or duplicates does not matter here (but the end of the self test displays them sorted and deduplicated), but codes must be valid and belong to only one of the two sequences).
Any missing language code will be checked with mw.language.new(code):isRTL(), which is costly in loaded resources (it can only check 20 languages at most including the content language) So it is best to map all languages that are the most likely to be used. --]==]
local rtlLangs = { 'aeb', 'aeb-arab', 'ar', 'arc', 'arq', 'ary', 'arz', 'azb', 'bcc', 'bgn', 'bqi', 'ckb', 'dv', 'fa', 'fa-af', 'glk', 'ha-arab', 'he', 'khw', 'kk-arab', 'kk-cn', 'ks-arab', 'ku-arab', 'lki', 'lrc', 'luz', 'mzn', 'nqo', 'ota', 'pnb', 'prd', 'ps', 'sd', 'sdh', 'skr', 'skr-arab', 'ug', 'ug-arab', 'ur', 'uz-arab', 'ydd', 'yi' }
local ltrLangs = { 'aa', 'ab', 'abs', 'ace', 'ady', 'ady-cyrl', 'aeb-latn', 'af', 'ak', 'aln', 'als', 'alt', 'am', 'ami', 'an', 'ang', 'anp', 'arn', 'as', 'ase', 'ast', 'atj', 'av', 'avk', 'awa', 'ay', 'az', 'ba', 'ban', 'bar', 'bat-smg', 'bbc', 'bbc-latn', 'bcl', 'be', 'be-tarask', 'be-x-old', 'bg', 'bh', 'bho', 'bi', 'bjn', 'bm', 'bn', 'bo', 'bpy', 'br', 'brh', 'bs', 'btm', 'bto', 'bu', 'bug', 'bxr', 'ca', 'cbk-zam', 'cdo', 'ce', 'ceb', 'ch', 'cho', 'chr', 'chy', 'co', 'cop', 'cps', 'cr', 'crh', 'crh-cyrl', 'crh-latn', 'cs', 'csb', 'cu', 'cv', 'cy', 'da', 'de', 'de-at', 'de-ch', 'de-formal', 'din', 'diq', 'dsb', 'dtp', 'dty', 'dz', 'ee', 'egl', 'el', 'eml', 'en', 'en-ca', 'en-gb', 'en-ie', 'en-us', 'eo', 'es', 'es-419', 'es-formal', 'et', 'eu', 'ext', 'ff', 'fi', 'fil', 'fit', 'fiu-vro', 'fj', 'fkv', 'fo', 'fr', 'frc', 'fro', 'frp', 'frr', 'fur', 'fy', 'ga', 'gag', 'gan', 'gan-hans', 'gan-hant', 'gcf', 'gcr', 'gd', 'gl', 'gn', 'gom', 'gom-deva', 'gom-latn', 'gor', 'got', 'grc', 'gsw', 'gu', 'gv', 'ha', 'hak', 'haw', 'hi', 'hif', 'hif-deva', 'hif-latn', 'hil', 'hmn', 'ho', 'hr', 'hrx', 'hsb', 'ht', 'hu', 'hu-formal', 'hy', 'hyw', 'hz', 'ia', 'id', 'ie', 'ig', 'ii', 'ik', 'ike-cans', 'ike-latn', 'ilo', 'inh', 'io', 'is', 'it', 'iu', 'ja', 'jam', 'jbo', 'jut', 'jv', 'ka', 'kaa', 'kab', 'kbd', 'kbd-cyrl', 'kbd-latn', 'kbp', 'kea', 'kg', 'ki', 'kiu', 'kj', 'kjp', 'kk', 'kk-cyrl', 'kk-kz', 'kk-latn', 'kk-tr', 'kl', 'km', 'kn', 'ko', 'ko-kp', 'ko-kr', 'koi', 'kr', 'krc', 'kri', 'krj', 'krl', 'ks', 'ks-deva', 'ksh', 'ku', 'ku-latn', 'kum', 'kv', 'kw', 'ky', 'la', 'lad', 'lb', 'lbe', 'lez', 'lfn', 'lg', 'li', 'lij', 'liv', 'lld', 'lmo', 'ln', 'lo', 'loz', 'lt', 'ltg', 'lus', 'lv', 'lzh', 'lzz', 'mai', 'map-bms', 'mdf', 'mg', 'mh', 'mhr', 'mi', 'min', 'mk', 'ml', 'mn', 'mni', 'mnw', 'mo', 'mr', 'mrj', 'ms', 'mt', 'mus', 'mwl', 'my', 'myv', 'na', 'nah', 'nan', 'nap', 'nb', 'nds', 'nds-nl', 'ne', 'new', 'ng', 'niu', 'nl', 'nl-informal', 'nn', 'no', 'nod', 'non', 'nov', 'nrf', 'nrf-fr', 'nrf-gg', 'nrf-je', 'nrm', 'nso', 'nv', 'ny', 'nys', 'oc', 'olo', 'om', 'or', 'os', 'pa', 'pag', 'pam', 'pap', 'pcd', 'pdc', 'pdt', 'pfl', 'pi', 'pih', 'pl', 'pms', 'pnt', 'prg', 'pt', 'pt-br', 'pt-cv', 'pt-pt', 'qu', 'quc', 'qug', 'rgn', 'rif', 'rm', 'rmf', 'rmy', 'rn', 'ro', 'roa-rup', 'roa-tara', 'ru', 'rue', 'rup', 'ruq', 'ruq-cyrl', 'ruq-latn', 'rw', 'rwr', 'sa', 'sah', 'sat', 'sc', 'scd', 'scn', 'sco', 'sdc', 'se', 'sei', 'ses', 'sg', 'sgs', 'sh', 'sh-cyrl', 'sh-latn', 'shi', 'shi-latn', 'shi-tfng', 'shn', 'shy-latn', 'si', 'simple', 'sjd', 'sje', 'sju', 'sk', 'sl', 'sli', 'sm', 'sma', 'smj', 'smn', 'sms', 'sn', 'so', 'sq', 'sr', 'sr-cyrl', 'sr-ec', 'sr-el', 'sr-latn', 'srn', 'srq', 'ss', 'st', 'stq', 'sty', 'su', 'sv', 'sw', 'szl', 'szy', 'ta', 'tay', 'tcy', 'te', 'tet', 'tg', 'tg-cyrl', 'tg-latn', 'th', 'ti', 'tk', 'tl', 'tly', 'tn', 'to', 'tokipona', 'tpi', 'tr', 'tru', 'trv', 'ts', 'tt', 'tt-cyrl', 'tt-latn', 'tum', 'tw', 'ty', 'tyv', 'tzl', 'tzm', 'udm', 'ug-latn', 'uk', 'uz', 'uz-cyrl', 'uz-latn', 've', 'vec', 'vep', 'vi', 'vls', 'vmf', 'vo', 'vot', 'vro', 'wa', 'war', 'wo', 'wuu', 'xal', 'xh', 'xmf', 'xsy', 'yo', 'yue', 'za', 'zea', 'zgh', 'zh', 'zh-classical', 'zh-cn', 'zh-hans', 'zh-hant', 'zh-hk', 'zh-min-nan', 'zh-mo', 'zh-my', 'zh-sg', 'zh-tw', 'zh-wuu', 'zh-yue', 'zu' }
-- Build the inverted map of languages to direction returned by this data module (fast, but collisions are not checked: run the test module) for _, lang in ipairs(rtlLangs) do p[lang] = true end for _, lang in ipairs(ltrLangs) do p[lang] = false end
-- Also store the two lists (at boolean indice), used by the test module to check the inverted map p[true] = rtlLangs p[false] = ltrLangs
return p</text>
<sha1>cxld5o18iaxkhru8z4aje5lec04qed1</sha1>
</revision>
</page>
<page>
<title>Template:SPARQLText</title>
<ns>10</ns>
<id>23033014</id>
<revision>
<id>1399250943</id>
<parentid>1399250772</parentid>
<timestamp>2021-04-10T14:44:00Z</timestamp>
<contributor>
<ip>87.126.92.234</ip>
</contributor>
<comment>Undid revision 1399250772 by 87.126.92.234 (talk)</comment>
<origin>1399250943</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="340" sha1="f35rnwtdn4sdogbp73jb3irfk0cvqp7" xml:space="preserve">{{#if:|
Template:IfTemplate:IfTemplate:IfTemplate:If }}3<noinclude>Template:Doc</noinclude></text>
<sha1>f35rnwtdn4sdogbp73jb3irfk0cvqp7</sha1>
</revision>
</page>
<page>
<title>Template:Int try it</title>
<ns>10</ns>
<id>109708780</id>
<redirect title="Template:Int run it" />
<revision>
<id>1764769125</id>
<timestamp>2022-11-04T21:44:15Z</timestamp>
<contributor>
<username>عُثمان</username>
<id>5050751</id>
</contributor>
<comment>عُثمان moved page Template:Int try it to Template:Int run it: the recent change to run it seems fine, but I was confused about where to find the template since the name did not match - move is inaccordance; redirects should resolve</comment>
<origin>1764769125</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="33" sha1="jwzw36nb8jui2zuk88ncwnse88o65qy" xml:space="preserve">#REDIRECT Template:Int run it</text>
<sha1>jwzw36nb8jui2zuk88ncwnse88o65qy</sha1>
</revision>
</page>
<page>
<title>Module:SPARQLMentions</title>
<ns>828</ns>
<id>28161729</id>
<revision>
<id>1453690994</id>
<parentid>661638891</parentid>
<timestamp>2021-07-04T13:54:47Z</timestamp>
<contributor>
<username>Azertus</username>
<id>1229135</id>
</contributor>
<comment>add getTitle</comment>
<origin>1453690994</origin>
<model>Scribunto</model>
<format>text/plain</format>
<text bytes="2760" sha1="lahzcbsmcekjpuk5o23yy8vvav8qfnz" xml:space="preserve">local p = {}
-- Return the label of a given data item, formatted for linking local function getLabel(frame, id, prefix) if prefix == nil then prefix = end if id == "defaultView:BubbleChart" then id = "Q24515280" end if id == "defaultView:Graph" then id = "Q24515287" end if id == "defaultView:Map" then id = "Q24515275" end
if id == "defaultView:ImageGrid" then id = "Q24515278" end
if id == "wikibase:box" then id = "Q26211169" end if id == "wikibase:cornerWest" then id = "Q26211177" end label = mw.wikibase.label( id ) if label == nil then linktext = id extra = else linktext = label .. " (" .. id .. ")" extra = ' ' .. frame:expandTemplate({ title="Reasonator", args= { [1] = id}}) .. ' ' .. frame:expandTemplate({ title="SQID", args= { [1] = id}}) end
link = mw.wikibase.getEntityUrl( id )
return '[' .. link .. ' ' .. linktext .. ']' .. extra; end
local function map(func, array)
local new_array = {}
for i,v in ipairs(array) do
new_array[i] = func(v)
end
return new_array
end
local function getAll(text, regexp, seen, items) if items == nil then items = {} end if seen == nil then seen = {} end for item in string.gmatch(text, regexp) do if seen[item] == nil then seen[item] = 1 table.insert(items, item) end end return items end
-- Produce list of items mentioned in the query
function p.getItems(frame)
if not mw.wikibase then
return "no mw.wikibase"
end
items = getAll(frame.args[1], 'wd:(Q%d+)') return table.concat(map(function(it) return getLabel(frame, it) end, items), ", ") end
-- Produce list of properties mentioned in the query function p.getProperties(frame) if not mw.wikibase then return "no mw.wikibase" end
seen = {} items = {} prefixes = {'wdt', 'p', 'ps', 'pr', 'pq', 'psv', 'pv', 'prv', 'pqv', 'wdtn', 'psn', 'pqn', 'prn', 'wdno' } for _, pr in ipairs(prefixes) do items = getAll(frame.args[1], pr .. ':(P%d+)', seen, items) end return table.concat(map(function(it) return getLabel(frame, it, 'Property:') end, items), ", ") end
function p.getFunctions(frame) if not mw.wikibase then return "no mw.wikibase" end
seen = {} items = {} func = {'defaultView:BubbleChart', 'defaultView:Graph', 'defaultView:Map', 'defaultView:ImageGrid', 'wikibase:box', "wikibase:cornerWest" } for _, pr in ipairs(func) do items = getAll(frame.args[1], pr, seen, items) end return table.concat(map(function(it) return getLabel(frame, it) end, items), ", ") end
function p.getTitle(frame) if not mw.wikibase then return "no mw.wikibase" end
for line in string.gmatch(frame.args[1], "[^%c]+%c?") do local title = string.match(line, '^#title:%s*([^%c]+)')
if not (title == nil) then return title end end end
return p</text>
<sha1>lahzcbsmcekjpuk5o23yy8vvav8qfnz</sha1>
</revision>
</page>
<page>
<title>Template:SQID</title>
<ns>10</ns>
<id>26259378</id>
<revision>
<id>1233859301</id>
<parentid>1227690908</parentid>
<timestamp>2020-07-18T14:13:28Z</timestamp>
<contributor>
<username>MisterSynergy</username>
<id>44949</id>
</contributor>
<comment>move URL to https://sqid.toolforge.org</comment>
<origin>1233859301</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="993" sha1="j6wq5aq6l7wsi92xtysclan6m8dprov" xml:space="preserve"><!--
-->{{#if: | Template:Q  }}<!-- -->{{#if: | Template:P  }}<!-- -->{{#if: | <span class="plainlinks">[https://sqid.toolforge.org/#{{#if:
| /view?id={{#if:
|
| {{#if:
| Q{{#titleparts:}}
| P{{#titleparts:}}
}}
}}&lang=⧼Lang⧽
| /?lang=⧼Lang⧽
}} ]</span>
}}<!-- --><nowiki/>?lang=⧼Lang⧽ }}<!-- --><noinclude>Template:Documentation</noinclude></text>
<sha1>j6wq5aq6l7wsi92xtysclan6m8dprov</sha1>
</revision>
</page>
<page>
<title>Template:Reasonator</title>
<ns>10</ns>
<id>17365939</id>
<revision>
<id>1556587517</id>
<parentid>1507464031</parentid>
<timestamp>2022-01-05T12:35:07Z</timestamp>
<contributor>
<username>Venca24</username>
<id>103280</id>
</contributor>
<comment>+ cs, eo</comment>
<origin>1556587517</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="882" sha1="ej9pd5v5fuipsemxo8gx8dbsqgg5vij" xml:space="preserve">{{#if:
| <span class="plainlinks">[3]</span> }} Template:TranslateThis<noinclude>Template:Documentation</noinclude></text>
<sha1>ej9pd5v5fuipsemxo8gx8dbsqgg5vij</sha1>
</revision>
</page>
<page>
<title>Template:WikiProject</title>
<ns>10</ns>
<id>21790485</id>
<revision>
<id>2298079997</id>
<parentid>2053606357</parentid>
<timestamp>2025-01-14T09:49:46Z</timestamp>
<contributor>
<username>Mormegil</username>
<id>28758</id>
</contributor>
<comment>+cs</comment>
<origin>2298079997</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="2446" sha1="afrxihplnkiijrydcgi7kwzg00a84sv" xml:space="preserve"><noinclude>Template:Doc</noinclude><!--
-->{{#ifexist: Wikidata:WikiProject <!--
#then:
-->|{{#if:<!--
#then:
-->|Template:Section link<!--
#else:
-->|Template:Ll<!--
-->}}<!--
#else:
-->|{{error<!--
-->|Template:TranslateThis<!--
-->}}<!--
--> <small>Template:TranslateThis<!--
--></small><!--
-->}}</text>
<sha1>afrxihplnkiijrydcgi7kwzg00a84sv</sha1>
</revision>
</page>
<page>
<title>Template:WikiProject/pagename</title>
<ns>10</ns>
<id>22491841</id>
<revision>
<id>1294585707</id>
<parentid>238479307</parentid>
<timestamp>2020-10-19T21:05:53Z</timestamp>
<contributor>
<username>Tacsipacsi</username>
<id>33956</id>
</contributor>
<comment>substitute template that doesn’t do what its name suggests and what it does in other projects</comment>
<origin>1294585707</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="60" sha1="8o2k69wu2sme8f490aakwi7ynj63jjv" xml:space="preserve">{{#if:|Wikidata Talk|Wikidata}}:WikiProject {{{1}}}</text>
<sha1>8o2k69wu2sme8f490aakwi7ynj63jjv</sha1>
</revision>
</page>
<page>
<title>Template:ItemOrNot</title>
<ns>10</ns>
<id>28161695</id>
<revision>
<id>361346548</id>
<parentid>361300782</parentid>
<timestamp>2016-08-02T21:22:10Z</timestamp>
<contributor>
<username>Smalyshev (WMF)</username>
<id>1482806</id>
</contributor>
<origin>361346548</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="384" sha1="230nkvb4w9pmw09vu3optxajqkjdr42" xml:space="preserve">{{#if: | * {{{1}}}: | }}<noinclude>
<templatedata> { "params": { "1": { "label": "List item name", "type": "string", "required": true }, "2": { "description": "List item contents", "type": "string" } }, "description": "Displays list item if second argument is not empty, otherwise nothing", "format": "block" } </templatedata> </noinclude></text>
<sha1>230nkvb4w9pmw09vu3optxajqkjdr42</sha1>
</revision>
</page>
<page>
<title>Template:Int Properties</title>
<ns>10</ns>
<id>25945270</id>
<revision>
<id>360948553</id>
<parentid>360948486</parentid>
<timestamp>2016-07-31T15:39:37Z</timestamp>
<contributor>
<username>Airon90</username>
<id>4782</id>
</contributor>
<origin>360948553</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="63" sha1="1f6bvc59pk8lngjngkff5ej07hrd17a" xml:space="preserve"><noinclude>Template:Doc</noinclude>Template:Capitalize</text>
<sha1>1f6bvc59pk8lngjngkff5ej07hrd17a</sha1>
</revision>
</page>
<page>
<title>Template:Int properties</title>
<ns>10</ns>
<id>25941214</id>
<revision>
<id>2504115378</id>
<parentid>2438818739</parentid>
<timestamp>2026-06-10T11:28:12Z</timestamp>
<contributor>
<username>مواطن تونسي</username>
<id>1537128</id>
</contributor>
<minor/>
<comment>traduction ar</comment>
<origin>2504115378</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="746" sha1="ao6colplfei84pspf07jmngpp7arssr" xml:space="preserve"><noinclude>Template:Doc</noinclude>Template:TranslateThis</text>
<sha1>ao6colplfei84pspf07jmngpp7arssr</sha1>
</revision>
</page>
<page>
<title>Template:SPARQL2/doc</title>
<ns>10</ns>
<id>35750675</id>
<revision>
<id>1425856775</id>
<parentid>1425856600</parentid>
<timestamp>2021-05-21T17:39:04Z</timestamp>
<contributor>
<username>PAC2</username>
<id>4892</id>
</contributor>
<comment>/* See also */ typo</comment>
<origin>1425856775</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="533" sha1="p2irk8qhdq7sqdc2n9kyjs3lvi2j5kw" xml:space="preserve"><nowiki>Template loop detected: Template:SPARQL2</nowiki>
Template loop detected: Template:SPARQL2
<nowiki>Template loop detected: Template:SPARQL2</nowiki>
Template loop detected: Template:SPARQL2
<nowiki>Template loop detected: Template:SPARQL2</nowiki>
Template loop detected: Template:SPARQL2
<nowiki>Template loop detected: Template:SPARQL2</nowiki>
Template loop detected: Template:SPARQL2
See also
<sha1>p2irk8qhdq7sqdc2n9kyjs3lvi2j5kw</sha1>
</revision>
</page>
<page>
<title>Template:Int run it</title>
<ns>10</ns>
<id>25022557</id>
<revision>
<id>2438820809</id>
<parentid>2033139854</parentid>
<timestamp>2025-12-06T14:46:20Z</timestamp>
<contributor>
<username>YeBoy371</username>
<id>2200680</id>
</contributor>
<origin>2438820809</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="1085" sha1="8ggotttekjqxrksv8jgpqj8yv3lzvla" xml:space="preserve"><noinclude>Template:Doc</noinclude>Template:TranslateThis</text>
<sha1>8ggotttekjqxrksv8jgpqj8yv3lzvla</sha1>
</revision>
</page>
</mediawiki>
<nowiki><mediawiki xmlns="http://www.mediawiki.org/xml/export-0.11/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.11/ http://www.mediawiki.org/xml/export-0.11.xsd" version="0.11" xml:lang="en">
<siteinfo> <sitename>Wikidata</sitename> <dbname>wikidatawiki</dbname> <base>https://www.wikidata.org/wiki/Wikidata:Main_Page</base> <generator>MediaWiki 1.47.0-wmf.17</generator> <case>first-letter</case> <namespaces> <namespace key="-2" case="first-letter">Media</namespace> <namespace key="-1" case="first-letter">Special</namespace> <namespace key="0" case="first-letter" /> <namespace key="1" case="first-letter">Talk</namespace> <namespace key="2" case="first-letter">User</namespace> <namespace key="3" case="first-letter">User talk</namespace> <namespace key="4" case="first-letter">Wikidata</namespace> <namespace key="5" case="first-letter">Wikidata talk</namespace> <namespace key="6" case="first-letter">File</namespace> <namespace key="7" case="first-letter">File talk</namespace> <namespace key="8" case="first-letter">MediaWiki</namespace> <namespace key="9" case="first-letter">MediaWiki talk</namespace> <namespace key="10" case="first-letter">Template</namespace> <namespace key="11" case="first-letter">Template talk</namespace> <namespace key="12" case="first-letter">Help</namespace> <namespace key="13" case="first-letter">Help talk</namespace> <namespace key="14" case="first-letter">Category</namespace> <namespace key="15" case="first-letter">Category talk</namespace> <namespace key="120" case="first-letter">Property</namespace> <namespace key="121" case="first-letter">Property talk</namespace> <namespace key="122" case="first-letter">Query</namespace> <namespace key="123" case="first-letter">Query talk</namespace> <namespace key="146" case="first-letter">Lexeme</namespace> <namespace key="147" case="first-letter">Lexeme talk</namespace> <namespace key="640" case="first-letter">EntitySchema</namespace> <namespace key="641" case="first-letter">EntitySchema talk</namespace> <namespace key="710" case="first-letter">TimedText</namespace> <namespace key="711" case="first-letter">TimedText talk</namespace> <namespace key="828" case="first-letter">Module</namespace> <namespace key="829" case="first-letter">Module talk</namespace> <namespace key="1198" case="first-letter">Translations</namespace> <namespace key="1199" case="first-letter">Translations talk</namespace> <namespace key="1728" case="first-letter">Event</namespace> <namespace key="1729" case="first-letter">Event talk</namespace> <namespace key="2600" case="first-letter">Topic</namespace> </namespaces> </siteinfo> <page> <title>Template:SPARQL2</title> <ns>10</ns> <id>28161690</id> <revision> <id>2346047691</id> <parentid>2346040648</parentid> <timestamp>2025-05-08T12:02:25Z</timestamp> <contributor> <username>Madamebiblio</username> <id>2952832</id> </contributor> <minor/> <comment>Reverted edits by 201.143.205.181 (talk) to last revision by Kokage si</comment> <origin>2294596805</origin> <model>wikitext</model> <format>text/x-wiki</format> <text bytes="7567" sha1="s4975lvx7s2i4pjji1govtxccu2rt3e" xml:space="preserve">Template:SPARQL2/doc
<onlyinclude>Template:Clear{{#ifeq:|{{{nohints}}}| <!--hidden hints--> | {{TranslateThis<!--
-->|ar=يستخدم الاستعلام التالي هذه:<!--
-->|be-tarask=Дадзены запыт выкарыстоўвае:<!--
-->|cs=Následující dotaz používá:<!--
-->|de=Die Suchanfrage verwendet:<!--
-->|en=The following query uses these:<!--
-->|en-gb=The following query uses these:<!--
-->|el=Το ακόλουθο ερώτημα χρησιμοποιεί αυτά:<!--
-->|es=La siguiente consulta utiliza lo siguiente:<!--
-->|fi=Seuraava kysely käyttää näitä:<!--
-->|fr=La requête suivante utilise ces :<!--
-->|hu=Ez a lekérdezés a következőket használja:<!--
-->|id=Kueri di bawah akan menggunakan entitas berikut:<!--
-->|it=La seguente query utilizza questi:<!--
-->|ja=以下のクエリではこれらを使用します:<!--
-->|nl=Deze query gebruikt:<!--
-->|pl=To zapytanie używa:<!--
-->|pt=A consulta seguinte utiliza estes:<!--
-->|pt-br=A consulta seguinte utiliza estes:<!--
-->|ru=Этот запрос использует:<!--
-->|sv=Följande fråga använder dessa:<!--
-->|tr=Aşağıdaki sorgu bunları kullanıyor:<!--
-->|uk=Цей запит використовує:<!--
-->}}<!-- -->Template:ItemOrNot <!-- -->Template:ItemOrNot <!-- -->Template:ItemOrNot <!--
-->}}
[[:Template:SPARQLText]]
<!-- --><div class="displayonly">{{#if: ||Template:Int try it}}</div>Template:Clear</onlyinclude><noinclude> <templatedata> { "params": { "query": { "required": true, "label": { "ar": "استعلام", "be-tarask": "запыт", "cs": "dotaz", "en": "query", "es": "consulta", "fr": "requête", "id": "kueri", "it": "query", "ja": "クエリ", "pl": "zapytanie", "pt": "consulta", "pt-br": "consulta", "sv": "fråga",
"tr": "sorgu",
"uk": "запит" }, "description": { "ar": "استعلام سباركل", "be-tarask": "запыт SPARQL", "cs": "SPARQL dotaz", "en": "SPARQL query", "es": "consulta SPARQL", "fr": "la requête que le modèle doit traiter et afficher", "id": "kueri SPARQL", "it": "query SPARQL", "ja": "SPARQLクエリ", "pl": "query SPARQL", "pt": "consulta SPARQL", "pt-br": "consulta SPARQL", "sv": "SPARQL fråga", "tr": "SPARQL sorgusu", "uk": "запит SPARQL" }, "example": { "be-tarask": "SELECT * WHERE { ?x wdt:P31 wd:Q5 } LIMIT 1", "cs": "SELECT * WHERE { ?x wdt:P31 wd:Q5 } LIMIT 1", "en": "SELECT * WHERE { ?x wdt:P31 wd:Q5 } LIMIT 1", "es": "SELECT ?item WHERE { ?item wdt:P31 wd:Q5 } LIMIT 1", "fr": "select ?item where { ?item wdt:P31 wd:Q5 } LIMIT 1", "id": "SELECT * WHERE { ?a wdt:P31 wd:Q5 } LIMIT 1", "it": "select ?item where { ?item wdt:P31 wd:Q5 } LIMIT 1", "pt": "select ?item where { ?item wdt:P31 wd:Q5 } LIMIT 1", "pt-br": "select ?item where { ?item wdt:P31 wd:Q5 } LIMIT 1" }, "type": "string", "aliases": [ "sparql" ], "suggested": true }, "extraprefix": { "description": { "ar": "بادئات إضافية لإضافتها",
"be-tarask": "дадатковыя прэфіксы (неабавязковыя)",
"cs": "Dodatečné prefixy (volitelné)", "en": "Extra prefixes to be added", "es": "Prefijos extra a añadir (opcional)", "fr": "les préfixes SPARQL non standards ou inconnus du service de requête éventuellement nécessaires (optionnel)", "id": "Prefiks SPARQL yang akan ditambahkan", "it": "Aggiungere i prefissi SPARQL non standard o sconosciuti eventualmente necessari (opzionale)", "ja": "追加する接頭辞(オプション)", "pl": "Dodatkowe prefiksy (opcjonalnie)", "pt": "Adicionar os prefixos SPARQL não padrões ou desconhecidos eventualmente necessários (opcional)", "pt-br": "Adicionar os prefixos SPARQL não padrões ou desconhecidos eventualmente necessários (opcional)", "uk": "Додаткові префікси (необов'язкові)" }, "example": "PREFIX wikibase: <http://wikiba.se/ontology#>", "type": "string" } }, "description": {
"be-tarask": "Гэты шаблён выводзіць запыт SPARQL з падсьветкай сынтаксісу, выкарыстаных элемэнтаў і спасылак на WDQS дзеля запуску запыту. \nЗРАБІЦЬ: скарыстаныя меткі элемэнтаў не лякалізаваныя",
"cs": "Tato šablona zobrazuje SPARQL dotaz ze zvýrazněnou syntaxí, použité položky a odkaz na WDQS dotazovací službu pro vyzkoušení.", "en": "This template displays SPARQL query with syntax highlighting, used items and link to WDQS query site to run the query. \nTODO: used items labels are not localized", "es": "Esta plantilla muestra una consulta SPARQL con resaltado de sintaxis, los items utilizados y un enlace al WDQS para lanzar la consulta", "fr": "Ce modèle affiche une requête SPARQL et permet de la lancer au travers du service de requête Wikidata. Il affiche aussi quelques informations basiques sur les éléments et fonctionnalités utilisées par cette requête", "id": "Templat ini menampilkan kueri SPARQL dengan pembedaan warna pada sintaks beserta entitas Wikidata yang digunakan dan pranala kueri di WDQS.", "it": "Questo template mostra una query SPARQL evidenziandone la sintassi e gli elementi usati e fornisce un link alla query WDQS site che permette di lanciare la query", "ja": "このテンプレートは構文強調付きのSPARQLクエリ、使用した項目、クエリを実行するWDQSクエリサイトへのリンクを表示します。", "pl": "Szablon wyświetla zapytanie SPARQL z podświetlaniem składni, listą użytych elementów i linkiem do WDQS.", "pt": "Esta predefinição mostra uma consulta SPARQL na qual evidencia a sintaxe e os elementos usados e fornece um enlace ao site WDQS que permite executar a consulta", "pt-br": "Esta predefinição mostra uma consulta SPARQL na qual evidencia a sintaxe e os elementos usados e fornece um enlace ao site WDQS que permite executar a consulta", "sv": "Denna mall visar en SPARQL fråga med syntaxfärgning, använda objekt och länk till WDQS frågesajten för att köra frågan. \nTODO: använda objekts etiketter är inte lokaliserade", "uk": "Цей шаблон показує запит SPARQL з підсвічуванням елементів синтаксису, список використаних елементів і посилання на сайт WDQS-запиту." }, "paramOrder": [ "query", "extraprefix" ], "format": "block" } </templatedata> </noinclude></text>
<sha1>s4975lvx7s2i4pjji1govtxccu2rt3e</sha1>
</revision>
</page>
<page>
<title>Template:Template</title>
<ns>10</ns>
<id>12414</id>
<redirect title="Template:Tl" />
<revision>
<id>431881</id>
<parentid>312894</parentid>
<timestamp>2012-11-13T02:07:50Z</timestamp>
<contributor>
<username>~riley</username>
<id>2219</id>
</contributor>
<comment>http://en.wikipedia.org/w/index.php?title=Template:Template&action=edit</comment>
<origin>431881</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="25" sha1="cdpzj9yp99pn5v093b404f4sc7cybv1" xml:space="preserve">#REDIRECT Template:Tl</text>
<sha1>cdpzj9yp99pn5v093b404f4sc7cybv1</sha1>
</revision>
</page>
<page>
<title>Template:Tl</title>
<ns>10</ns>
<id>3170</id>
<revision>
<id>2508986920</id>
<parentid>1946850712</parentid>
<timestamp>2026-06-22T01:25:21Z</timestamp>
<contributor>
<username>RogueScholar</username>
<id>3003918</id>
</contributor>
<minor/>
<comment>Format template code for readability and convert numeric HTML entities to named equivalents to accomplish the same</comment>
<origin>2508986920</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="1299" sha1="dqel96mgakegupz568kpnt91rdib9m4" xml:space="preserve"><includeonly><code>{{{{#if:|subst:}}<!-- Begin evaluation of first parameter.
-->{{#ifeq:{|:|:[[]]|<!-- If already prefixed by colon, show the link as such, too.
-->{{#switch:<!-- Target's namespace determines the link format. -->
| | Template = [[Template:|]]<!-- Main: (absent) or Template: namespaces -->
| File | Category = [[:{{{1}}}]]<!-- File and Category namespaces receive hidden colon prefix. -->
| #default = [[{{{1}}}]]<!-- All others are linked verbatim.
-->}}<!-- End of switch function. -->}}<!-- End of first parameter evaluation.
-->{{#ifeq: {{{2}}}| x||{{{2}}}}}<!--
-->{{#ifeq: {{{3}}}| x||{{{3}}}}}<!--
-->{{#ifeq: {{{4}}}| x||{{{4}}}}}<!--
-->{{#ifeq: {{{5}}}| x||{{{5}}}}}<!--
-->{{#ifeq: {{{6}}}| x||{{{6}}}}}<!--
-->{{#ifeq: {{{7}}}| x||{{{7}}}}}<!--
-->{{#ifeq: {{{8}}}| x||{{{8}}}}}<!--
-->{{#ifeq: {{{9}}}| x||{{{9}}}}}<!--
-->{{#ifeq:{{{10}}}|x||{{{10}}}}}}}</code></includeonly><noinclude>
Template:Documentation</noinclude></text>
<sha1>dqel96mgakegupz568kpnt91rdib9m4</sha1>
</revision>
</page>
<page>
<title>Template:Capitalize</title>
<ns>10</ns>
<id>24835143</id>
<revision>
<id>2283223741</id>
<parentid>2282968755</parentid>
<timestamp>2024-12-03T22:55:49Z</timestamp>
<contributor>
<username>Tacsipacsi</username>
<id>33956</id>
</contributor>
<comment>Undid revision 2282968755 by 2806:2F0:A080:F124:78E9:9300:6983:EA83 (talk): ???</comment>
<origin>2283223741</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="100" sha1="08bgnnmlolmwjwag381zkq615fl2s0a" xml:space="preserve"><includeonly>Script error: No such module "Capitalize".</includeonly><noinclude>
Template:Doc </noinclude></text>
<sha1>08bgnnmlolmwjwag381zkq615fl2s0a</sha1>
</revision>
</page>
<page>
<title>Template:Int items</title>
<ns>10</ns>
<id>28641837</id>
<revision>
<id>2438810545</id>
<parentid>2208740771</parentid>
<timestamp>2025-12-06T14:15:50Z</timestamp>
<contributor>
<username>YeBoy371</username>
<id>2200680</id>
</contributor>
<origin>2438810545</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="475" sha1="knyh87z85w0os01yxpmvrzvlnwf07fb" xml:space="preserve"><noinclude>Template:Doc</noinclude>Template:TranslateThis</text>
<sha1>knyh87z85w0os01yxpmvrzvlnwf07fb</sha1>
</revision>
</page>
<page>
<title>Module:Capitalize</title>
<ns>828</ns>
<id>25940912</id>
<revision>
<id>333880118</id>
<parentid>327538585</parentid>
<timestamp>2016-05-08T21:08:10Z</timestamp>
<contributor>
<username>TomT0m</username>
<id>7333</id>
</contributor>
<comment>cap after the tags</comment>
<origin>333880118</origin>
<model>Scribunto</model>
<format>text/plain</format>
<text bytes="518" sha1="oi3oo9q42s5okxrm5hbfy01zk32pehp" xml:space="preserve">
local p = {}
function p.cap(str) lang = mw.getContentLanguage() if lang:ucfirst(str) ~= str then return lang:ucfirst(str) else local substr = mw.ustring.sub b, e = mw.ustring.find(str, ">%s*%a") while e ~= nil do if mw.ustring.find(">", substr(str, b,e)) == nil then return substr(str, 1, e-1) .. lang:ucfirst(substr(str,e,e)) ..substr(str, e+1) end b, e = mw.ustring.find(str, ">%s*%a", e) end return str end end
function p.capitalize(frame) return p.cap(frame.args[1]) end
return p</text>
<sha1>oi3oo9q42s5okxrm5hbfy01zk32pehp</sha1>
</revision>
</page>
<page>
<title>Template:Clear</title>
<ns>10</ns>
<id>12131100</id>
<revision>
<id>665474881</id>
<parentid>91992232</parentid>
<timestamp>2018-04-14T18:59:12Z</timestamp>
<contributor>
<username>Dataeast0000001</username>
<id>2952466</id>
</contributor>
<comment>move onlyinclude to noinclude</comment>
<origin>665474881</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="79" sha1="5aa2j06l3n3husy1g6jggf6oznzocau" xml:space="preserve"><div style="clear:both;"></div><noinclude>Template:Documentation</noinclude></text>
<sha1>5aa2j06l3n3husy1g6jggf6oznzocau</sha1>
</revision>
</page>
<page>
<title>Module:Fallback</title>
<ns>828</ns>
<id>19181086</id>
<revision>
<id>714642825</id>
<parentid>714642495</parentid>
<timestamp>2018-07-23T16:35:03Z</timestamp>
<contributor>
<username>Matěj Suchánek</username>
<id>53613</id>
</contributor>
<minor/>
<comment>fix</comment>
<origin>714642825</origin>
<model>Scribunto</model>
<format>text/plain</format>
<text bytes="5559" sha1="6vr2in87podxnsj3x2jttt1r1qisf9q" xml:space="preserve">local p = {}
function p.fblist(lang, langonly) -- list the full fallback chain from a language to en local fbtable = mw.language.getFallbacksFor(lang) table.insert(fbtable, 1, lang) if not langonly then table.insert(fbtable, 'message') table.insert(fbtable, 'item') table.insert(fbtable, 'default') end return fbtable end
function p._langSwitch(args, lang) -- args: table of translations -- Return error if there is not default and no English version -- otherwise returns the message in the most appropriate, plus the lang code as a second value if not args.en and not args.default and not args.message and not args.item and args.nocat ~= '1' then return error("langSwitch error: no default") end -- get language (either stated one or user's default language) if not lang then return '<strong class="error">LangSwitch Error: no lang</strong>' -- must become proper error end -- get the list of acceptable language (lang + those in lang's fallback chain) and check their content for i, j in ipairs(p.fblist(lang)) do if args[j] then if args[j] == '~' then return nil, j end if j == 'item' then local label, lang = mw.wikibase.getLabelWithLang(args[j]) if label then return label, lang else return args[j], 'en' end end if j == 'message' then return tostring(mw.message.new(args[j]):inLanguage(lang)) end -- if this is an interface message if args[j] ~= then return args[j], j end end end return nil end
function p.langSwitch(frame) -- version to be used from wikitext local args = frame.args -- if no expected args provided than check parent template/module args if not args.en and not args.default and not args.nocat then args = frame:getParent().args end local lang if args.lang and args.lang ~= then lang = args.lang args.lang = nil else -- get user's chosen language lang = frame:preprocess( "⧼lang⧽" ) end local str, language = p._langSwitch(args, lang) return str -- get the first value of the langSwitch, (the text) not the second (the language) end
function p.fallbackpage(base, lang, formatting) local languages = p.fblist(lang) for i, lng in ipairs(languages) do if mw.title.new(base .. '/' .. lng).exists then if formatting == 'table' then return {base .. '/' .. lng, lng} -- returns name of the page + name of the language else return base .. '/' .. lng -- returns only the page end end end return base end
function p.autotranslate(frame) -- logic for template:Autotranslate local args = frame.args if not args.lang or args.lang == then args.lang = frame:preprocess( "⧼lang⧽" ) -- get user's chosen language end
-- find base page local base = args.base if not base or base == then return '<strong class="error">Base page not provided for autotranslate</strong>' end if string.sub(base, 2, 9) ~= 'emplate:' then base = 'Template:' .. base -- base provided without 'Template:' part end
-- find base template language subpage local page = p.fallbackpage(base, args.lang) -- if (not page and base ~= args.base) then -- try the original args.base string. This case is only needed if base is not in template namespace page = p.fallbackpage(args.base, args.lang) end if not page then return string.format('<strong class="error">no fallback page found for autotranslate (base=%s, lang=%s)</strong>', args.base, args.lang) end
-- repack args in a standard table local newargs = {} for field, value in pairs(args) do if field ~= 'base' then newargs[field] = value end end
-- Transclude Template:Page with template arguments the same as the ones passed to Template:Autotranslate template. return frame:expandTemplate{ title = page, args = newargs } end
function p.translate(page, key, lang) --translate data stored in a module if type(page) == 'string' then -- if the requested translation table is not yet loaded page = require('Module:' .. page) end
local val if page[key] then val = page[key] elseif page.keys and page.keys[key] then-- key 'keys" is an index of all keys, including redirects, see Module:i18n/datatype val = page.keys[key] end if not val then return '<' .. key .. '>' end return p._langSwitch(val, lang) end
function p.translatelua(frame) local lang = frame.args.lang local page = require('Module:' .. mw.text.trim(frame.args[1])) -- page should only contain a simple of translations if not lang or mw.text.trim(lang) == then lang = frame:preprocess( "⧼lang⧽" ) end if frame.args[2] then page = page[mw.text.trim(frame.args[2])] end return p._langSwitch(page, lang) end
function p.runTests() local toFallbackTest = require('Module:Fallback/tests/fallbacks') local result = true
mw.log('Testing fallback chains') for i, t in ipairs(toFallbackTest) do local fbtbl = table.concat(p.fblist(t.initial), ', ') local expected = table.concat(t.expected, ', ') local ret = (fbtbl == expected) mw.log(i, ret and 'passed' or 'FAILED', t.initial, (not ret) and ('FAILED\nis >>' .. fbtbl .. '<<\nbut should be >>' .. expected .. '<<\n') or ) result = result and ret end
return result end
function p.showTemplateArguments(frame) -- list all input arguments of the template that calls "Script error: No such module "Fallback"." local str = for name, value in pairs( frame:getParent().args ) do if str == then str = string.format('%s=%s', name, value) -- argument #1 else str = string.format('%s, %s=%s', str, name, value) -- the rest end end return str end
return p</text>
<sha1>6vr2in87podxnsj3x2jttt1r1qisf9q</sha1>
</revision>
</page>
<page>
<title>Template:Ll</title>
<ns>10</ns>
<id>3264473</id>
<revision>
<id>618665821</id>
<parentid>443393354</parentid>
<timestamp>2018-01-11T02:59:59Z</timestamp>
<contributor>
<username>Jarekt</username>
<id>1274</id>
</contributor>
<comment>Fulfilling edit request by User:Kaganer. Thanks for helping!</comment>
<origin>618665821</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="178" sha1="h8s4unutwk14jcbyfcq88r5yvqbu5x5" xml:space="preserve">[[Special:MyLanguage/{{{1}}}{{#if:|#{{{anchor}}}}}|Template:PDT</includeonly>]]<noinclude>
Template:Documentation </noinclude></text>
<sha1>h8s4unutwk14jcbyfcq88r5yvqbu5x5</sha1>
</revision>
</page>
<page>
<title>Template:TranslateThis</title>
<ns>10</ns>
<id>16552759</id>
<revision>
<id>483148362</id>
<parentid>483129342</parentid>
<timestamp>2017-05-08T01:54:31Z</timestamp>
<contributor>
<username>MKar</username>
<id>6110</id>
</contributor>
<minor/>
<comment>Undid revision 483129342 by 70.71.90.6 (talk)</comment>
<origin>483148362</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="97" sha1="rm4lztokzfib496c8sbt9q36vx6n9tz" xml:space="preserve"><includeonly>Script error: No such module "TranslateThis".</includeonly><noinclude>Template:Documentation</noinclude></text>
<sha1>rm4lztokzfib496c8sbt9q36vx6n9tz</sha1>
</revision>
</page>
<page>
<title>Module:TranslateThis</title>
<ns>828</ns>
<id>16552706</id>
<revision>
<id>2144500220</id>
<parentid>1980692436</parentid>
<timestamp>2024-05-04T13:29:50Z</timestamp>
<contributor>
<username>Uzume</username>
<id>11596</id>
</contributor>
<comment>switch frame:preprocess("⧼lang⧽") to callParserFunction("int", "lang")</comment>
<origin>2144500220</origin>
<model>Scribunto</model>
<format>text/plain</format>
<text bytes="1738" sha1="j2it1vjxk477pw54t7yheap3g9xt452" xml:space="preserve">local fb = require('Module:Fallback')
local dir = require('Module:Dir')
return { main = function( frame )
local function shallowcopy(orig) if type(orig) ~= 'table' then return orig end
local result = {} for key, value in pairs(orig) do result[key] = value end return result end
local args = shallowcopy(frame:getParent().args) local lang = args.lang or frame:callParserFunction("int", "lang") -- I don't know of any other way to get the user's language... args.lang = nil
local anchor = args.anchor args.anchor = nil if (anchor and args[anchor]) then anchor = args[anchor] end anchor = anchor and frame:expandTemplate( { title = "Anchor", args = { anchor } } ) or
local result = args[ lang ] if result and result ~= then result = '<span dir="' .. dir.select(lang, 'rtl', 'ltr') .. '" lang="' .. lang .. '">' .. result .. '</span>' else local default = {} for i, v in pairs( args ) do if v ~= "" then table.insert(default, '<span dir="' .. dir.select(i, 'rtl', 'ltr') .. '" lang="' .. i .. '">' .. v .. '</span> <small>(' .. i .. ')</small>') end end default = table.concat(default, ' / ') args.default=default local newlang result, newlang = fb._langSwitch(args, lang) if not newlang then result = elseif newlang~='default' then result = '<span dir="' .. dir.select(newlang, 'rtl', 'ltr') .. '" lang="' .. newlang .. '">' .. result .. '</span> <small>(' .. newlang .. ')</small>' end local langname = mw.language.fetchLanguageName( lang, lang ) if langname ~= "" and newlang then result = result .. " – " .. frame:expandTemplate( { title = "Help translate", args = { langname, lang = lang } } ) end end
return anchor .. result end}</text>
<sha1>j2it1vjxk477pw54t7yheap3g9xt452</sha1>
</revision>
</page>
<page>
<title>Module:Dir</title>
<ns>828</ns>
<id>95388294</id>
<revision>
<id>1935187194</id>
<parentid>1935159027</parentid>
<timestamp>2023-07-15T22:41:28Z</timestamp>
<contributor>
<username>Tacsipacsi</username>
<id>33956</id>
</contributor>
<comment>Undid revision 1935159027 by 177.232.91.83 (talk): test edit</comment>
<origin>1935187194</origin>
<model>Scribunto</model>
<format>text/plain</format>
<text bytes="5612" sha1="n6dnippb8dl8nupbrxgqviac0hno50v" xml:space="preserve">-- This module implements Template:Dir.
-- local rtlOverrides = mw.loadData('Module:Dir/RTL overrides') -- !!! mw.loadData() is currently broken, it does NOT load anything local rtlOverrides = require('Module:Dir/RTL overrides') local p = {}
local function trim(s)
if s and s ~= then s = tostring(s):match('^%s*(.-)%s*$') end
if s == then return nil end
return s
end
function p.rtlLangs(isRTL)
if isRTL == nil then isRTL = true end
return rtlOverrides[isRTL] or {}
end
function p.isRTL(code)
if type(code) ~= 'string' then return nil end
local v = rtlOverrides[code] -- very fast and not limited in the number of supported languages
if v ~= nil then return v end -- return it if mapped, otherwise use MediaWiki library:
local success, ret = pcall(function ()
return mw.language.new(code):isRTL() -- expensive and limited to 20 languages per MediaWiki instance
end)
return success and ret
end
function p.select(code, rtl, ltr)
if p.isRTL(code) then
return rtl
else
return ltr
end
end
-- Used via a template Template:Dir -- which just calls Script error: No such module "Dir"., the 3 parameters are automatically trimmed: -- Parameter 1 takes the default value from ⧼Lang⧽ if it's empty or not specified. -- Parameter 2 can be named rtl, may be explicitly empty, otherwise takes the default value 'rtl' only if it's not specified. -- Parameter 3 can be named ltr, may be explicitly empty, otherwise takes the default value 'ltr' only if it's not specified. function p.main(frame)
local args = frame:getParent().args -- Parameters used to transclude Template:Dir
local code = trim(args[1]) or frame:callParserFunction('Int', 'Lang')
local rtl = trim(args.rtl or args[2] or 'rtl')
local ltr = trim(args.ltr or args[3] or 'ltr')
return p.select(code, rtl, ltr)
end
setmetatable(p, { quickTests = function ()
local rtlLangs = p.rtlLangs(true) local ltrLangs = p.rtlLangs(false)
-- Basic check of data format
local function checkLangs(name, langs)
for k, lang in pairs(langs) do
assert(type(k) == 'number' and k == math.floor(k)
and type(lang) == 'string' and #lang >= 2 and #lang <= 16
and lang:find('^[a-z][%-0-9a-z]*[0-9a-z]$') == 1,
": Invalid sequence of language codes, " .. name .. "['" .. k .. "'] = '" .. lang .. "'")
end
return true
end
local ok, msg
ok, msg = pcall(checkLangs, 'rtlLangs', rtlLangs)
if not ok then return false, msg end
ok, msg = pcall(checkLangs, 'ltrLangs', ltrLangs)
if not ok then return false, msg end
-- Build inverse maps of languages having each direction
local isrtl, isltr = {}, {}
for _, lang in ipairs(rtlLangs) do isrtl[lang] = true end
for _, lang in ipairs(ltrLangs) do isltr[lang] = true end
-- Check conflicts using the two inverse maps
for _, lang in ipairs(rtlLangs) do
if isltr[lang] then return false, ": Direction conflict for '" .. lang .. "'" end
end
for _, lang in ipairs(ltrLangs) do
if isrtl[lang] then return false, ": Direction conflict for '" .. lang .. "'" end
end
-- Log missing languages (allows filling the tables above) according to MediaWiki internal data
local knownLangs, isKnownLang = mw.language.fetchLanguageNames(), {}
for lang, _ in pairs(knownLangs) do
isKnownLang[lang] = true
if rtlOverrides[lang] == nil then -- only if we still don't have data for this language
-- Note: we cannot check more than 20 languages at once, then MediaWiki raises an error.
-- So this test only runs on the Lua console, where you can update the tables at top.
-- This also means we cannot compare what MediaWiki returns with the direction we map here for all languages.
ok, value = pcall(function() return tostring(mw.language.new(lang):isRTL()) end)
mw.log("Warning: missing direction for language '" .. lang .. "', MediaWiki returns '" .. value .. "'")
end
end
-- utility: reverse order iterator on sequences
local function revipairs(t)
return function(t, i)
i = i - 1
local v = t[i]
if v == nil then return nil end
return i, v
end, t, #t + 1
end
-- Sort and deduplicate language code values (by scanning backward) for data cleanup
-- Also log languages having a direction mapping in this module but still not known by MediaWiki
table.sort(rtlLangs)
table.sort(ltrLangs)
for i, lang in revipairs(rtlLangs) do
if rtlLangs[i - 1] == rtlLangs[i] then table.remove(rtlLangs, i) end
if isKnownLang[lang] == nil then
mw.log("RTL language '" .. lang .. "' still not known by Mediawiki (could be a missing alias or variant)")
end
end
for i, lang in revipairs(ltrLangs) do
if ltrLangs[i - 1] == ltrLangs[i] then table.remove(ltrLangs, i) end
if isKnownLang[lang] == nil then
mw.log("LTR language '" .. lang .. "' still not known by Mediawiki (could be a missing alias or variant)")
end
end
-- Final presentation of current lists, sorted and deduplicated
mw.log("----")
mw.log("local rtlLangs = { '" .. table.concat(rtlLangs, "', '") .. "' }")
mw.log("local ltrLangs = { '" .. table.concat(ltrLangs, "', '") .. "' }")
return true
end }) --[==[ Enter this to run tests in the Lua console: =getmetatable(p).quickTests() --]==]
return p</text>
<sha1>n6dnippb8dl8nupbrxgqviac0hno50v</sha1>
</revision>
</page>
<page>
<title>Module:Dir/RTL overrides</title>
<ns>828</ns>
<id>95388411</id>
<revision>
<id>1223091335</id>
<timestamp>2020-07-03T04:07:06Z</timestamp>
<contributor>
<username>Amitie 10g</username>
<id>185006</id>
</contributor>
<comment>Created page with "local p = {} --[==[ Basic input sequences: relative order or duplicates does not matter here (but the end of the self test displays them sorted and deduplicated), but codes m..."</comment>
<origin>1223091335</origin>
<model>Scribunto</model>
<format>text/plain</format>
<text bytes="4566" sha1="cxld5o18iaxkhru8z4aje5lec04qed1" xml:space="preserve">local p = {}
--[==[ Basic input sequences: relative order or duplicates does not matter here (but the end of the self test displays them sorted and deduplicated), but codes must be valid and belong to only one of the two sequences).
Any missing language code will be checked with mw.language.new(code):isRTL(), which is costly in loaded resources (it can only check 20 languages at most including the content language) So it is best to map all languages that are the most likely to be used. --]==]
local rtlLangs = { 'aeb', 'aeb-arab', 'ar', 'arc', 'arq', 'ary', 'arz', 'azb', 'bcc', 'bgn', 'bqi', 'ckb', 'dv', 'fa', 'fa-af', 'glk', 'ha-arab', 'he', 'khw', 'kk-arab', 'kk-cn', 'ks-arab', 'ku-arab', 'lki', 'lrc', 'luz', 'mzn', 'nqo', 'ota', 'pnb', 'prd', 'ps', 'sd', 'sdh', 'skr', 'skr-arab', 'ug', 'ug-arab', 'ur', 'uz-arab', 'ydd', 'yi' }
local ltrLangs = { 'aa', 'ab', 'abs', 'ace', 'ady', 'ady-cyrl', 'aeb-latn', 'af', 'ak', 'aln', 'als', 'alt', 'am', 'ami', 'an', 'ang', 'anp', 'arn', 'as', 'ase', 'ast', 'atj', 'av', 'avk', 'awa', 'ay', 'az', 'ba', 'ban', 'bar', 'bat-smg', 'bbc', 'bbc-latn', 'bcl', 'be', 'be-tarask', 'be-x-old', 'bg', 'bh', 'bho', 'bi', 'bjn', 'bm', 'bn', 'bo', 'bpy', 'br', 'brh', 'bs', 'btm', 'bto', 'bu', 'bug', 'bxr', 'ca', 'cbk-zam', 'cdo', 'ce', 'ceb', 'ch', 'cho', 'chr', 'chy', 'co', 'cop', 'cps', 'cr', 'crh', 'crh-cyrl', 'crh-latn', 'cs', 'csb', 'cu', 'cv', 'cy', 'da', 'de', 'de-at', 'de-ch', 'de-formal', 'din', 'diq', 'dsb', 'dtp', 'dty', 'dz', 'ee', 'egl', 'el', 'eml', 'en', 'en-ca', 'en-gb', 'en-ie', 'en-us', 'eo', 'es', 'es-419', 'es-formal', 'et', 'eu', 'ext', 'ff', 'fi', 'fil', 'fit', 'fiu-vro', 'fj', 'fkv', 'fo', 'fr', 'frc', 'fro', 'frp', 'frr', 'fur', 'fy', 'ga', 'gag', 'gan', 'gan-hans', 'gan-hant', 'gcf', 'gcr', 'gd', 'gl', 'gn', 'gom', 'gom-deva', 'gom-latn', 'gor', 'got', 'grc', 'gsw', 'gu', 'gv', 'ha', 'hak', 'haw', 'hi', 'hif', 'hif-deva', 'hif-latn', 'hil', 'hmn', 'ho', 'hr', 'hrx', 'hsb', 'ht', 'hu', 'hu-formal', 'hy', 'hyw', 'hz', 'ia', 'id', 'ie', 'ig', 'ii', 'ik', 'ike-cans', 'ike-latn', 'ilo', 'inh', 'io', 'is', 'it', 'iu', 'ja', 'jam', 'jbo', 'jut', 'jv', 'ka', 'kaa', 'kab', 'kbd', 'kbd-cyrl', 'kbd-latn', 'kbp', 'kea', 'kg', 'ki', 'kiu', 'kj', 'kjp', 'kk', 'kk-cyrl', 'kk-kz', 'kk-latn', 'kk-tr', 'kl', 'km', 'kn', 'ko', 'ko-kp', 'ko-kr', 'koi', 'kr', 'krc', 'kri', 'krj', 'krl', 'ks', 'ks-deva', 'ksh', 'ku', 'ku-latn', 'kum', 'kv', 'kw', 'ky', 'la', 'lad', 'lb', 'lbe', 'lez', 'lfn', 'lg', 'li', 'lij', 'liv', 'lld', 'lmo', 'ln', 'lo', 'loz', 'lt', 'ltg', 'lus', 'lv', 'lzh', 'lzz', 'mai', 'map-bms', 'mdf', 'mg', 'mh', 'mhr', 'mi', 'min', 'mk', 'ml', 'mn', 'mni', 'mnw', 'mo', 'mr', 'mrj', 'ms', 'mt', 'mus', 'mwl', 'my', 'myv', 'na', 'nah', 'nan', 'nap', 'nb', 'nds', 'nds-nl', 'ne', 'new', 'ng', 'niu', 'nl', 'nl-informal', 'nn', 'no', 'nod', 'non', 'nov', 'nrf', 'nrf-fr', 'nrf-gg', 'nrf-je', 'nrm', 'nso', 'nv', 'ny', 'nys', 'oc', 'olo', 'om', 'or', 'os', 'pa', 'pag', 'pam', 'pap', 'pcd', 'pdc', 'pdt', 'pfl', 'pi', 'pih', 'pl', 'pms', 'pnt', 'prg', 'pt', 'pt-br', 'pt-cv', 'pt-pt', 'qu', 'quc', 'qug', 'rgn', 'rif', 'rm', 'rmf', 'rmy', 'rn', 'ro', 'roa-rup', 'roa-tara', 'ru', 'rue', 'rup', 'ruq', 'ruq-cyrl', 'ruq-latn', 'rw', 'rwr', 'sa', 'sah', 'sat', 'sc', 'scd', 'scn', 'sco', 'sdc', 'se', 'sei', 'ses', 'sg', 'sgs', 'sh', 'sh-cyrl', 'sh-latn', 'shi', 'shi-latn', 'shi-tfng', 'shn', 'shy-latn', 'si', 'simple', 'sjd', 'sje', 'sju', 'sk', 'sl', 'sli', 'sm', 'sma', 'smj', 'smn', 'sms', 'sn', 'so', 'sq', 'sr', 'sr-cyrl', 'sr-ec', 'sr-el', 'sr-latn', 'srn', 'srq', 'ss', 'st', 'stq', 'sty', 'su', 'sv', 'sw', 'szl', 'szy', 'ta', 'tay', 'tcy', 'te', 'tet', 'tg', 'tg-cyrl', 'tg-latn', 'th', 'ti', 'tk', 'tl', 'tly', 'tn', 'to', 'tokipona', 'tpi', 'tr', 'tru', 'trv', 'ts', 'tt', 'tt-cyrl', 'tt-latn', 'tum', 'tw', 'ty', 'tyv', 'tzl', 'tzm', 'udm', 'ug-latn', 'uk', 'uz', 'uz-cyrl', 'uz-latn', 've', 'vec', 'vep', 'vi', 'vls', 'vmf', 'vo', 'vot', 'vro', 'wa', 'war', 'wo', 'wuu', 'xal', 'xh', 'xmf', 'xsy', 'yo', 'yue', 'za', 'zea', 'zgh', 'zh', 'zh-classical', 'zh-cn', 'zh-hans', 'zh-hant', 'zh-hk', 'zh-min-nan', 'zh-mo', 'zh-my', 'zh-sg', 'zh-tw', 'zh-wuu', 'zh-yue', 'zu' }
-- Build the inverted map of languages to direction returned by this data module (fast, but collisions are not checked: run the test module) for _, lang in ipairs(rtlLangs) do p[lang] = true end for _, lang in ipairs(ltrLangs) do p[lang] = false end
-- Also store the two lists (at boolean indice), used by the test module to check the inverted map p[true] = rtlLangs p[false] = ltrLangs
return p</text>
<sha1>cxld5o18iaxkhru8z4aje5lec04qed1</sha1>
</revision>
</page>
<page>
<title>Template:SPARQLText</title>
<ns>10</ns>
<id>23033014</id>
<revision>
<id>1399250943</id>
<parentid>1399250772</parentid>
<timestamp>2021-04-10T14:44:00Z</timestamp>
<contributor>
<ip>87.126.92.234</ip>
</contributor>
<comment>Undid revision 1399250772 by 87.126.92.234 (talk)</comment>
<origin>1399250943</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="340" sha1="f35rnwtdn4sdogbp73jb3irfk0cvqp7" xml:space="preserve">{{#if:|
Template:IfTemplate:IfTemplate:IfTemplate:If }}1 2<noinclude>Template:Doc</noinclude></text>
<sha1>f35rnwtdn4sdogbp73jb3irfk0cvqp7</sha1>
</revision>
</page>
<page>
<title>Template:Int try it</title>
<ns>10</ns>
<id>109708780</id>
<redirect title="Template:Int run it" />
<revision>
<id>1764769125</id>
<timestamp>2022-11-04T21:44:15Z</timestamp>
<contributor>
<username>عُثمان</username>
<id>5050751</id>
</contributor>
<comment>عُثمان moved page Template:Int try it to Template:Int run it: the recent change to run it seems fine, but I was confused about where to find the template since the name did not match - move is inaccordance; redirects should resolve</comment>
<origin>1764769125</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="33" sha1="jwzw36nb8jui2zuk88ncwnse88o65qy" xml:space="preserve">#REDIRECT Template:Int run it</text>
<sha1>jwzw36nb8jui2zuk88ncwnse88o65qy</sha1>
</revision>
</page>
<page>
<title>Module:SPARQLMentions</title>
<ns>828</ns>
<id>28161729</id>
<revision>
<id>1453690994</id>
<parentid>661638891</parentid>
<timestamp>2021-07-04T13:54:47Z</timestamp>
<contributor>
<username>Azertus</username>
<id>1229135</id>
</contributor>
<comment>add getTitle</comment>
<origin>1453690994</origin>
<model>Scribunto</model>
<format>text/plain</format>
<text bytes="2760" sha1="lahzcbsmcekjpuk5o23yy8vvav8qfnz" xml:space="preserve">local p = {}
-- Return the label of a given data item, formatted for linking local function getLabel(frame, id, prefix) if prefix == nil then prefix = end if id == "defaultView:BubbleChart" then id = "Q24515280" end if id == "defaultView:Graph" then id = "Q24515287" end if id == "defaultView:Map" then id = "Q24515275" end
if id == "defaultView:ImageGrid" then id = "Q24515278" end
if id == "wikibase:box" then id = "Q26211169" end if id == "wikibase:cornerWest" then id = "Q26211177" end label = mw.wikibase.label( id ) if label == nil then linktext = id extra = else linktext = label .. " (" .. id .. ")" extra = ' ' .. frame:expandTemplate({ title="Reasonator", args= { [1] = id}}) .. ' ' .. frame:expandTemplate({ title="SQID", args= { [1] = id}}) end
link = mw.wikibase.getEntityUrl( id )
return '[' .. link .. ' ' .. linktext .. ']' .. extra; end
local function map(func, array)
local new_array = {}
for i,v in ipairs(array) do
new_array[i] = func(v)
end
return new_array
end
local function getAll(text, regexp, seen, items) if items == nil then items = {} end if seen == nil then seen = {} end for item in string.gmatch(text, regexp) do if seen[item] == nil then seen[item] = 1 table.insert(items, item) end end return items end
-- Produce list of items mentioned in the query
function p.getItems(frame)
if not mw.wikibase then
return "no mw.wikibase"
end
items = getAll(frame.args[1], 'wd:(Q%d+)') return table.concat(map(function(it) return getLabel(frame, it) end, items), ", ") end
-- Produce list of properties mentioned in the query function p.getProperties(frame) if not mw.wikibase then return "no mw.wikibase" end
seen = {} items = {} prefixes = {'wdt', 'p', 'ps', 'pr', 'pq', 'psv', 'pv', 'prv', 'pqv', 'wdtn', 'psn', 'pqn', 'prn', 'wdno' } for _, pr in ipairs(prefixes) do items = getAll(frame.args[1], pr .. ':(P%d+)', seen, items) end return table.concat(map(function(it) return getLabel(frame, it, 'Property:') end, items), ", ") end
function p.getFunctions(frame) if not mw.wikibase then return "no mw.wikibase" end
seen = {} items = {} func = {'defaultView:BubbleChart', 'defaultView:Graph', 'defaultView:Map', 'defaultView:ImageGrid', 'wikibase:box', "wikibase:cornerWest" } for _, pr in ipairs(func) do items = getAll(frame.args[1], pr, seen, items) end return table.concat(map(function(it) return getLabel(frame, it) end, items), ", ") end
function p.getTitle(frame) if not mw.wikibase then return "no mw.wikibase" end
for line in string.gmatch(frame.args[1], "[^%c]+%c?") do local title = string.match(line, '^#title:%s*([^%c]+)')
if not (title == nil) then return title end end end
return p</text>
<sha1>lahzcbsmcekjpuk5o23yy8vvav8qfnz</sha1>
</revision>
</page>
<page>
<title>Template:SQID</title>
<ns>10</ns>
<id>26259378</id>
<revision>
<id>1233859301</id>
<parentid>1227690908</parentid>
<timestamp>2020-07-18T14:13:28Z</timestamp>
<contributor>
<username>MisterSynergy</username>
<id>44949</id>
</contributor>
<comment>move URL to https://sqid.toolforge.org</comment>
<origin>1233859301</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="993" sha1="j6wq5aq6l7wsi92xtysclan6m8dprov" xml:space="preserve"><!--
-->{{#if: | Template:Q  }}<!-- -->{{#if: | Template:P  }}<!-- -->{{#if: | <span class="plainlinks">[https://sqid.toolforge.org/#{{#if:
| /view?id={{#if:
|
| {{#if:
| Q{{#titleparts:}}
| P{{#titleparts:}}
}}
}}&lang=⧼Lang⧽
| /?lang=⧼Lang⧽
}} ]</span>
}}<!-- --><nowiki/>?lang=⧼Lang⧽ }}<!-- --><noinclude>Template:Documentation</noinclude></text>
<sha1>j6wq5aq6l7wsi92xtysclan6m8dprov</sha1>
</revision>
</page>
<page>
<title>Template:Reasonator</title>
<ns>10</ns>
<id>17365939</id>
<revision>
<id>1556587517</id>
<parentid>1507464031</parentid>
<timestamp>2022-01-05T12:35:07Z</timestamp>
<contributor>
<username>Venca24</username>
<id>103280</id>
</contributor>
<comment>+ cs, eo</comment>
<origin>1556587517</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="882" sha1="ej9pd5v5fuipsemxo8gx8dbsqgg5vij" xml:space="preserve">{{#if:
| <span class="plainlinks">[4]</span> }} Template:TranslateThis<noinclude>Template:Documentation</noinclude></text>
<sha1>ej9pd5v5fuipsemxo8gx8dbsqgg5vij</sha1>
</revision>
</page>
<page>
<title>Template:WikiProject</title>
<ns>10</ns>
<id>21790485</id>
<revision>
<id>2298079997</id>
<parentid>2053606357</parentid>
<timestamp>2025-01-14T09:49:46Z</timestamp>
<contributor>
<username>Mormegil</username>
<id>28758</id>
</contributor>
<comment>+cs</comment>
<origin>2298079997</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="2446" sha1="afrxihplnkiijrydcgi7kwzg00a84sv" xml:space="preserve"><noinclude>Template:Doc</noinclude><!--
-->{{#ifexist: Wikidata:WikiProject <!--
#then:
-->|{{#if:<!--
#then:
-->|Template:Section link<!--
#else:
-->|Template:Ll<!--
-->}}<!--
#else:
-->|{{error<!--
-->|Template:TranslateThis<!--
-->}}<!--
--> <small>Template:TranslateThis<!--
--></small><!--
-->}}</text>
<sha1>afrxihplnkiijrydcgi7kwzg00a84sv</sha1>
</revision>
</page>
<page>
<title>Template:WikiProject/pagename</title>
<ns>10</ns>
<id>22491841</id>
<revision>
<id>1294585707</id>
<parentid>238479307</parentid>
<timestamp>2020-10-19T21:05:53Z</timestamp>
<contributor>
<username>Tacsipacsi</username>
<id>33956</id>
</contributor>
<comment>substitute template that doesn’t do what its name suggests and what it does in other projects</comment>
<origin>1294585707</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="60" sha1="8o2k69wu2sme8f490aakwi7ynj63jjv" xml:space="preserve">{{#if:|Wikidata Talk|Wikidata}}:WikiProject {{{1}}}</text>
<sha1>8o2k69wu2sme8f490aakwi7ynj63jjv</sha1>
</revision>
</page>
<page>
<title>Template:ItemOrNot</title>
<ns>10</ns>
<id>28161695</id>
<revision>
<id>361346548</id>
<parentid>361300782</parentid>
<timestamp>2016-08-02T21:22:10Z</timestamp>
<contributor>
<username>Smalyshev (WMF)</username>
<id>1482806</id>
</contributor>
<origin>361346548</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="384" sha1="230nkvb4w9pmw09vu3optxajqkjdr42" xml:space="preserve">{{#if: | * {{{1}}}: | }}<noinclude>
<templatedata> { "params": { "1": { "label": "List item name", "type": "string", "required": true }, "2": { "description": "List item contents", "type": "string" } }, "description": "Displays list item if second argument is not empty, otherwise nothing", "format": "block" } </templatedata> </noinclude></text>
<sha1>230nkvb4w9pmw09vu3optxajqkjdr42</sha1>
</revision>
</page>
<page>
<title>Template:Int Properties</title>
<ns>10</ns>
<id>25945270</id>
<revision>
<id>360948553</id>
<parentid>360948486</parentid>
<timestamp>2016-07-31T15:39:37Z</timestamp>
<contributor>
<username>Airon90</username>
<id>4782</id>
</contributor>
<origin>360948553</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="63" sha1="1f6bvc59pk8lngjngkff5ej07hrd17a" xml:space="preserve"><noinclude>Template:Doc</noinclude>Template:Capitalize</text>
<sha1>1f6bvc59pk8lngjngkff5ej07hrd17a</sha1>
</revision>
</page>
<page>
<title>Template:Int properties</title>
<ns>10</ns>
<id>25941214</id>
<revision>
<id>2504115378</id>
<parentid>2438818739</parentid>
<timestamp>2026-06-10T11:28:12Z</timestamp>
<contributor>
<username>مواطن تونسي</username>
<id>1537128</id>
</contributor>
<minor/>
<comment>traduction ar</comment>
<origin>2504115378</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="746" sha1="ao6colplfei84pspf07jmngpp7arssr" xml:space="preserve"><noinclude>Template:Doc</noinclude>Template:TranslateThis</text>
<sha1>ao6colplfei84pspf07jmngpp7arssr</sha1>
</revision>
</page>
<page>
<title>Template:SPARQL2/doc</title>
<ns>10</ns>
<id>35750675</id>
<revision>
<id>1425856775</id>
<parentid>1425856600</parentid>
<timestamp>2021-05-21T17:39:04Z</timestamp>
<contributor>
<username>PAC2</username>
<id>4892</id>
</contributor>
<comment>/* See also */ typo</comment>
<origin>1425856775</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="533" sha1="p2irk8qhdq7sqdc2n9kyjs3lvi2j5kw" xml:space="preserve"><nowiki>Template loop detected: Template:SPARQL2</nowiki>
Template loop detected: Template:SPARQL2
<nowiki>Template loop detected: Template:SPARQL2</nowiki>
Template loop detected: Template:SPARQL2
<nowiki>Template loop detected: Template:SPARQL2</nowiki>
Template loop detected: Template:SPARQL2
<nowiki>Template loop detected: Template:SPARQL2</nowiki>
Template loop detected: Template:SPARQL2
See also
<sha1>p2irk8qhdq7sqdc2n9kyjs3lvi2j5kw</sha1>
</revision>
</page>
<page>
<title>Template:Int run it</title>
<ns>10</ns>
<id>25022557</id>
<revision>
<id>2438820809</id>
<parentid>2033139854</parentid>
<timestamp>2025-12-06T14:46:20Z</timestamp>
<contributor>
<username>YeBoy371</username>
<id>2200680</id>
</contributor>
<origin>2438820809</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="1085" sha1="8ggotttekjqxrksv8jgpqj8yv3lzvla" xml:space="preserve"><noinclude>Template:Doc</noinclude>Template:TranslateThis</text>
<sha1>8ggotttekjqxrksv8jgpqj8yv3lzvla</sha1>
</revision>
</page>
</mediawiki></nowiki>
<mediawiki xmlns="http://www.mediawiki.org/xml/export-0.11/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.11/ http://www.mediawiki.org/xml/export-0.11.xsd" version="0.11" xml:lang="en">
<siteinfo> <sitename>Wikidata</sitename> <dbname>wikidatawiki</dbname> <base>https://www.wikidata.org/wiki/Wikidata:Main_Page</base> <generator>MediaWiki 1.47.0-wmf.17</generator> <case>first-letter</case> <namespaces> <namespace key="-2" case="first-letter">Media</namespace> <namespace key="-1" case="first-letter">Special</namespace> <namespace key="0" case="first-letter" /> <namespace key="1" case="first-letter">Talk</namespace> <namespace key="2" case="first-letter">User</namespace> <namespace key="3" case="first-letter">User talk</namespace> <namespace key="4" case="first-letter">Wikidata</namespace> <namespace key="5" case="first-letter">Wikidata talk</namespace> <namespace key="6" case="first-letter">File</namespace> <namespace key="7" case="first-letter">File talk</namespace> <namespace key="8" case="first-letter">MediaWiki</namespace> <namespace key="9" case="first-letter">MediaWiki talk</namespace> <namespace key="10" case="first-letter">Template</namespace> <namespace key="11" case="first-letter">Template talk</namespace> <namespace key="12" case="first-letter">Help</namespace> <namespace key="13" case="first-letter">Help talk</namespace> <namespace key="14" case="first-letter">Category</namespace> <namespace key="15" case="first-letter">Category talk</namespace> <namespace key="120" case="first-letter">Property</namespace> <namespace key="121" case="first-letter">Property talk</namespace> <namespace key="122" case="first-letter">Query</namespace> <namespace key="123" case="first-letter">Query talk</namespace> <namespace key="146" case="first-letter">Lexeme</namespace> <namespace key="147" case="first-letter">Lexeme talk</namespace> <namespace key="640" case="first-letter">EntitySchema</namespace> <namespace key="641" case="first-letter">EntitySchema talk</namespace> <namespace key="710" case="first-letter">TimedText</namespace> <namespace key="711" case="first-letter">TimedText talk</namespace> <namespace key="828" case="first-letter">Module</namespace> <namespace key="829" case="first-letter">Module talk</namespace> <namespace key="1198" case="first-letter">Translations</namespace> <namespace key="1199" case="first-letter">Translations talk</namespace> <namespace key="1728" case="first-letter">Event</namespace> <namespace key="1729" case="first-letter">Event talk</namespace> <namespace key="2600" case="first-letter">Topic</namespace> </namespaces> </siteinfo> <page> <title>Template:SPARQL2</title> <ns>10</ns> <id>28161690</id> <revision> <id>2346047691</id> <parentid>2346040648</parentid> <timestamp>2025-05-08T12:02:25Z</timestamp> <contributor> <username>Madamebiblio</username> <id>2952832</id> </contributor> <minor/> <comment>Reverted edits by 201.143.205.181 (talk) to last revision by Kokage si</comment> <origin>2294596805</origin> <model>wikitext</model> <format>text/x-wiki</format> <text bytes="7567" sha1="s4975lvx7s2i4pjji1govtxccu2rt3e" xml:space="preserve">Template:SPARQL2/doc
<onlyinclude>Template:Clear{{#ifeq:|{{{nohints}}}| <!--hidden hints--> | {{TranslateThis<!--
-->|ar=يستخدم الاستعلام التالي هذه:<!--
-->|be-tarask=Дадзены запыт выкарыстоўвае:<!--
-->|cs=Následující dotaz používá:<!--
-->|de=Die Suchanfrage verwendet:<!--
-->|en=The following query uses these:<!--
-->|en-gb=The following query uses these:<!--
-->|el=Το ακόλουθο ερώτημα χρησιμοποιεί αυτά:<!--
-->|es=La siguiente consulta utiliza lo siguiente:<!--
-->|fi=Seuraava kysely käyttää näitä:<!--
-->|fr=La requête suivante utilise ces :<!--
-->|hu=Ez a lekérdezés a következőket használja:<!--
-->|id=Kueri di bawah akan menggunakan entitas berikut:<!--
-->|it=La seguente query utilizza questi:<!--
-->|ja=以下のクエリではこれらを使用します:<!--
-->|nl=Deze query gebruikt:<!--
-->|pl=To zapytanie używa:<!--
-->|pt=A consulta seguinte utiliza estes:<!--
-->|pt-br=A consulta seguinte utiliza estes:<!--
-->|ru=Этот запрос использует:<!--
-->|sv=Följande fråga använder dessa:<!--
-->|tr=Aşağıdaki sorgu bunları kullanıyor:<!--
-->|uk=Цей запит використовує:<!--
-->}}<!-- -->Template:ItemOrNot <!-- -->Template:ItemOrNot <!-- -->Template:ItemOrNot <!--
-->}}
[[:Template:SPARQLText]]
<!-- --><div class="displayonly">{{#if: ||Template:Int try it}}</div>Template:Clear</onlyinclude><noinclude> <templatedata> { "params": { "query": { "required": true, "label": { "ar": "استعلام", "be-tarask": "запыт", "cs": "dotaz", "en": "query", "es": "consulta", "fr": "requête", "id": "kueri", "it": "query", "ja": "クエリ", "pl": "zapytanie", "pt": "consulta", "pt-br": "consulta", "sv": "fråga",
"tr": "sorgu",
"uk": "запит" }, "description": { "ar": "استعلام سباركل", "be-tarask": "запыт SPARQL", "cs": "SPARQL dotaz", "en": "SPARQL query", "es": "consulta SPARQL", "fr": "la requête que le modèle doit traiter et afficher", "id": "kueri SPARQL", "it": "query SPARQL", "ja": "SPARQLクエリ", "pl": "query SPARQL", "pt": "consulta SPARQL", "pt-br": "consulta SPARQL", "sv": "SPARQL fråga", "tr": "SPARQL sorgusu", "uk": "запит SPARQL" }, "example": { "be-tarask": "SELECT * WHERE { ?x wdt:P31 wd:Q5 } LIMIT 1", "cs": "SELECT * WHERE { ?x wdt:P31 wd:Q5 } LIMIT 1", "en": "SELECT * WHERE { ?x wdt:P31 wd:Q5 } LIMIT 1", "es": "SELECT ?item WHERE { ?item wdt:P31 wd:Q5 } LIMIT 1", "fr": "select ?item where { ?item wdt:P31 wd:Q5 } LIMIT 1", "id": "SELECT * WHERE { ?a wdt:P31 wd:Q5 } LIMIT 1", "it": "select ?item where { ?item wdt:P31 wd:Q5 } LIMIT 1", "pt": "select ?item where { ?item wdt:P31 wd:Q5 } LIMIT 1", "pt-br": "select ?item where { ?item wdt:P31 wd:Q5 } LIMIT 1" }, "type": "string", "aliases": [ "sparql" ], "suggested": true }, "extraprefix": { "description": { "ar": "بادئات إضافية لإضافتها",
"be-tarask": "дадатковыя прэфіксы (неабавязковыя)",
"cs": "Dodatečné prefixy (volitelné)", "en": "Extra prefixes to be added", "es": "Prefijos extra a añadir (opcional)", "fr": "les préfixes SPARQL non standards ou inconnus du service de requête éventuellement nécessaires (optionnel)", "id": "Prefiks SPARQL yang akan ditambahkan", "it": "Aggiungere i prefissi SPARQL non standard o sconosciuti eventualmente necessari (opzionale)", "ja": "追加する接頭辞(オプション)", "pl": "Dodatkowe prefiksy (opcjonalnie)", "pt": "Adicionar os prefixos SPARQL não padrões ou desconhecidos eventualmente necessários (opcional)", "pt-br": "Adicionar os prefixos SPARQL não padrões ou desconhecidos eventualmente necessários (opcional)", "uk": "Додаткові префікси (необов'язкові)" }, "example": "PREFIX wikibase: <http://wikiba.se/ontology#>", "type": "string" } }, "description": {
"be-tarask": "Гэты шаблён выводзіць запыт SPARQL з падсьветкай сынтаксісу, выкарыстаных элемэнтаў і спасылак на WDQS дзеля запуску запыту. \nЗРАБІЦЬ: скарыстаныя меткі элемэнтаў не лякалізаваныя",
"cs": "Tato šablona zobrazuje SPARQL dotaz ze zvýrazněnou syntaxí, použité položky a odkaz na WDQS dotazovací službu pro vyzkoušení.", "en": "This template displays SPARQL query with syntax highlighting, used items and link to WDQS query site to run the query. \nTODO: used items labels are not localized", "es": "Esta plantilla muestra una consulta SPARQL con resaltado de sintaxis, los items utilizados y un enlace al WDQS para lanzar la consulta", "fr": "Ce modèle affiche une requête SPARQL et permet de la lancer au travers du service de requête Wikidata. Il affiche aussi quelques informations basiques sur les éléments et fonctionnalités utilisées par cette requête", "id": "Templat ini menampilkan kueri SPARQL dengan pembedaan warna pada sintaks beserta entitas Wikidata yang digunakan dan pranala kueri di WDQS.", "it": "Questo template mostra una query SPARQL evidenziandone la sintassi e gli elementi usati e fornisce un link alla query WDQS site che permette di lanciare la query", "ja": "このテンプレートは構文強調付きのSPARQLクエリ、使用した項目、クエリを実行するWDQSクエリサイトへのリンクを表示します。", "pl": "Szablon wyświetla zapytanie SPARQL z podświetlaniem składni, listą użytych elementów i linkiem do WDQS.", "pt": "Esta predefinição mostra uma consulta SPARQL na qual evidencia a sintaxe e os elementos usados e fornece um enlace ao site WDQS que permite executar a consulta", "pt-br": "Esta predefinição mostra uma consulta SPARQL na qual evidencia a sintaxe e os elementos usados e fornece um enlace ao site WDQS que permite executar a consulta", "sv": "Denna mall visar en SPARQL fråga med syntaxfärgning, använda objekt och länk till WDQS frågesajten för att köra frågan. \nTODO: använda objekts etiketter är inte lokaliserade", "uk": "Цей шаблон показує запит SPARQL з підсвічуванням елементів синтаксису, список використаних елементів і посилання на сайт WDQS-запиту." }, "paramOrder": [ "query", "extraprefix" ], "format": "block" } </templatedata> </noinclude></text>
<sha1>s4975lvx7s2i4pjji1govtxccu2rt3e</sha1>
</revision>
</page>
<page>
<title>Template:Template</title>
<ns>10</ns>
<id>12414</id>
<redirect title="Template:Tl" />
<revision>
<id>431881</id>
<parentid>312894</parentid>
<timestamp>2012-11-13T02:07:50Z</timestamp>
<contributor>
<username>~riley</username>
<id>2219</id>
</contributor>
<comment>http://en.wikipedia.org/w/index.php?title=Template:Template&action=edit</comment>
<origin>431881</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="25" sha1="cdpzj9yp99pn5v093b404f4sc7cybv1" xml:space="preserve">#REDIRECT Template:Tl</text>
<sha1>cdpzj9yp99pn5v093b404f4sc7cybv1</sha1>
</revision>
</page>
<page>
<title>Template:Tl</title>
<ns>10</ns>
<id>3170</id>
<revision>
<id>2508986920</id>
<parentid>1946850712</parentid>
<timestamp>2026-06-22T01:25:21Z</timestamp>
<contributor>
<username>RogueScholar</username>
<id>3003918</id>
</contributor>
<minor/>
<comment>Format template code for readability and convert numeric HTML entities to named equivalents to accomplish the same</comment>
<origin>2508986920</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="1299" sha1="dqel96mgakegupz568kpnt91rdib9m4" xml:space="preserve"><includeonly><code>{{{{#if:|subst:}}<!-- Begin evaluation of first parameter.
-->{{#ifeq:{|:|:[[]]|<!-- If already prefixed by colon, show the link as such, too.
-->{{#switch:<!-- Target's namespace determines the link format. -->
| | Template = [[Template:|]]<!-- Main: (absent) or Template: namespaces -->
| File | Category = [[:{{{1}}}]]<!-- File and Category namespaces receive hidden colon prefix. -->
| #default = [[{{{1}}}]]<!-- All others are linked verbatim.
-->}}<!-- End of switch function. -->}}<!-- End of first parameter evaluation.
-->{{#ifeq: {{{2}}}| x||{{{2}}}}}<!--
-->{{#ifeq: {{{3}}}| x||{{{3}}}}}<!--
-->{{#ifeq: {{{4}}}| x||{{{4}}}}}<!--
-->{{#ifeq: {{{5}}}| x||{{{5}}}}}<!--
-->{{#ifeq: {{{6}}}| x||{{{6}}}}}<!--
-->{{#ifeq: {{{7}}}| x||{{{7}}}}}<!--
-->{{#ifeq: {{{8}}}| x||{{{8}}}}}<!--
-->{{#ifeq: {{{9}}}| x||{{{9}}}}}<!--
-->{{#ifeq:{{{10}}}|x||{{{10}}}}}}}</code></includeonly><noinclude>
Template:Documentation</noinclude></text>
<sha1>dqel96mgakegupz568kpnt91rdib9m4</sha1>
</revision>
</page>
<page>
<title>Template:Capitalize</title>
<ns>10</ns>
<id>24835143</id>
<revision>
<id>2283223741</id>
<parentid>2282968755</parentid>
<timestamp>2024-12-03T22:55:49Z</timestamp>
<contributor>
<username>Tacsipacsi</username>
<id>33956</id>
</contributor>
<comment>Undid revision 2282968755 by 2806:2F0:A080:F124:78E9:9300:6983:EA83 (talk): ???</comment>
<origin>2283223741</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="100" sha1="08bgnnmlolmwjwag381zkq615fl2s0a" xml:space="preserve"><includeonly>Script error: No such module "Capitalize".</includeonly><noinclude>
Template:Doc </noinclude></text>
<sha1>08bgnnmlolmwjwag381zkq615fl2s0a</sha1>
</revision>
</page>
<page>
<title>Template:Int items</title>
<ns>10</ns>
<id>28641837</id>
<revision>
<id>2438810545</id>
<parentid>2208740771</parentid>
<timestamp>2025-12-06T14:15:50Z</timestamp>
<contributor>
<username>YeBoy371</username>
<id>2200680</id>
</contributor>
<origin>2438810545</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="475" sha1="knyh87z85w0os01yxpmvrzvlnwf07fb" xml:space="preserve"><noinclude>Template:Doc</noinclude>Template:TranslateThis</text>
<sha1>knyh87z85w0os01yxpmvrzvlnwf07fb</sha1>
</revision>
</page>
<page>
<title>Module:Capitalize</title>
<ns>828</ns>
<id>25940912</id>
<revision>
<id>333880118</id>
<parentid>327538585</parentid>
<timestamp>2016-05-08T21:08:10Z</timestamp>
<contributor>
<username>TomT0m</username>
<id>7333</id>
</contributor>
<comment>cap after the tags</comment>
<origin>333880118</origin>
<model>Scribunto</model>
<format>text/plain</format>
<text bytes="518" sha1="oi3oo9q42s5okxrm5hbfy01zk32pehp" xml:space="preserve">
local p = {}
function p.cap(str) lang = mw.getContentLanguage() if lang:ucfirst(str) ~= str then return lang:ucfirst(str) else local substr = mw.ustring.sub b, e = mw.ustring.find(str, ">%s*%a") while e ~= nil do if mw.ustring.find(">", substr(str, b,e)) == nil then return substr(str, 1, e-1) .. lang:ucfirst(substr(str,e,e)) ..substr(str, e+1) end b, e = mw.ustring.find(str, ">%s*%a", e) end return str end end
function p.capitalize(frame) return p.cap(frame.args[1]) end
return p</text>
<sha1>oi3oo9q42s5okxrm5hbfy01zk32pehp</sha1>
</revision>
</page>
<page>
<title>Template:Clear</title>
<ns>10</ns>
<id>12131100</id>
<revision>
<id>665474881</id>
<parentid>91992232</parentid>
<timestamp>2018-04-14T18:59:12Z</timestamp>
<contributor>
<username>Dataeast0000001</username>
<id>2952466</id>
</contributor>
<comment>move onlyinclude to noinclude</comment>
<origin>665474881</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="79" sha1="5aa2j06l3n3husy1g6jggf6oznzocau" xml:space="preserve"><div style="clear:both;"></div><noinclude>Template:Documentation</noinclude></text>
<sha1>5aa2j06l3n3husy1g6jggf6oznzocau</sha1>
</revision>
</page>
<page>
<title>Module:Fallback</title>
<ns>828</ns>
<id>19181086</id>
<revision>
<id>714642825</id>
<parentid>714642495</parentid>
<timestamp>2018-07-23T16:35:03Z</timestamp>
<contributor>
<username>Matěj Suchánek</username>
<id>53613</id>
</contributor>
<minor/>
<comment>fix</comment>
<origin>714642825</origin>
<model>Scribunto</model>
<format>text/plain</format>
<text bytes="5559" sha1="6vr2in87podxnsj3x2jttt1r1qisf9q" xml:space="preserve">local p = {}
function p.fblist(lang, langonly) -- list the full fallback chain from a language to en local fbtable = mw.language.getFallbacksFor(lang) table.insert(fbtable, 1, lang) if not langonly then table.insert(fbtable, 'message') table.insert(fbtable, 'item') table.insert(fbtable, 'default') end return fbtable end
function p._langSwitch(args, lang) -- args: table of translations -- Return error if there is not default and no English version -- otherwise returns the message in the most appropriate, plus the lang code as a second value if not args.en and not args.default and not args.message and not args.item and args.nocat ~= '1' then return error("langSwitch error: no default") end -- get language (either stated one or user's default language) if not lang then return '<strong class="error">LangSwitch Error: no lang</strong>' -- must become proper error end -- get the list of acceptable language (lang + those in lang's fallback chain) and check their content for i, j in ipairs(p.fblist(lang)) do if args[j] then if args[j] == '~' then return nil, j end if j == 'item' then local label, lang = mw.wikibase.getLabelWithLang(args[j]) if label then return label, lang else return args[j], 'en' end end if j == 'message' then return tostring(mw.message.new(args[j]):inLanguage(lang)) end -- if this is an interface message if args[j] ~= then return args[j], j end end end return nil end
function p.langSwitch(frame) -- version to be used from wikitext local args = frame.args -- if no expected args provided than check parent template/module args if not args.en and not args.default and not args.nocat then args = frame:getParent().args end local lang if args.lang and args.lang ~= then lang = args.lang args.lang = nil else -- get user's chosen language lang = frame:preprocess( "⧼lang⧽" ) end local str, language = p._langSwitch(args, lang) return str -- get the first value of the langSwitch, (the text) not the second (the language) end
function p.fallbackpage(base, lang, formatting) local languages = p.fblist(lang) for i, lng in ipairs(languages) do if mw.title.new(base .. '/' .. lng).exists then if formatting == 'table' then return {base .. '/' .. lng, lng} -- returns name of the page + name of the language else return base .. '/' .. lng -- returns only the page end end end return base end
function p.autotranslate(frame) -- logic for template:Autotranslate local args = frame.args if not args.lang or args.lang == then args.lang = frame:preprocess( "⧼lang⧽" ) -- get user's chosen language end
-- find base page local base = args.base if not base or base == then return '<strong class="error">Base page not provided for autotranslate</strong>' end if string.sub(base, 2, 9) ~= 'emplate:' then base = 'Template:' .. base -- base provided without 'Template:' part end
-- find base template language subpage local page = p.fallbackpage(base, args.lang) -- if (not page and base ~= args.base) then -- try the original args.base string. This case is only needed if base is not in template namespace page = p.fallbackpage(args.base, args.lang) end if not page then return string.format('<strong class="error">no fallback page found for autotranslate (base=%s, lang=%s)</strong>', args.base, args.lang) end
-- repack args in a standard table local newargs = {} for field, value in pairs(args) do if field ~= 'base' then newargs[field] = value end end
-- Transclude Template:Page with template arguments the same as the ones passed to Template:Autotranslate template. return frame:expandTemplate{ title = page, args = newargs } end
function p.translate(page, key, lang) --translate data stored in a module if type(page) == 'string' then -- if the requested translation table is not yet loaded page = require('Module:' .. page) end
local val if page[key] then val = page[key] elseif page.keys and page.keys[key] then-- key 'keys" is an index of all keys, including redirects, see Module:i18n/datatype val = page.keys[key] end if not val then return '<' .. key .. '>' end return p._langSwitch(val, lang) end
function p.translatelua(frame) local lang = frame.args.lang local page = require('Module:' .. mw.text.trim(frame.args[1])) -- page should only contain a simple of translations if not lang or mw.text.trim(lang) == then lang = frame:preprocess( "⧼lang⧽" ) end if frame.args[2] then page = page[mw.text.trim(frame.args[2])] end return p._langSwitch(page, lang) end
function p.runTests() local toFallbackTest = require('Module:Fallback/tests/fallbacks') local result = true
mw.log('Testing fallback chains') for i, t in ipairs(toFallbackTest) do local fbtbl = table.concat(p.fblist(t.initial), ', ') local expected = table.concat(t.expected, ', ') local ret = (fbtbl == expected) mw.log(i, ret and 'passed' or 'FAILED', t.initial, (not ret) and ('FAILED\nis >>' .. fbtbl .. '<<\nbut should be >>' .. expected .. '<<\n') or ) result = result and ret end
return result end
function p.showTemplateArguments(frame) -- list all input arguments of the template that calls "Script error: No such module "Fallback"." local str = for name, value in pairs( frame:getParent().args ) do if str == then str = string.format('%s=%s', name, value) -- argument #1 else str = string.format('%s, %s=%s', str, name, value) -- the rest end end return str end
return p</text>
<sha1>6vr2in87podxnsj3x2jttt1r1qisf9q</sha1>
</revision>
</page>
<page>
<title>Template:Ll</title>
<ns>10</ns>
<id>3264473</id>
<revision>
<id>618665821</id>
<parentid>443393354</parentid>
<timestamp>2018-01-11T02:59:59Z</timestamp>
<contributor>
<username>Jarekt</username>
<id>1274</id>
</contributor>
<comment>Fulfilling edit request by User:Kaganer. Thanks for helping!</comment>
<origin>618665821</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="178" sha1="h8s4unutwk14jcbyfcq88r5yvqbu5x5" xml:space="preserve">[[Special:MyLanguage/{{{1}}}{{#if:|#{{{anchor}}}}}|Template:PDT</includeonly>]]<noinclude>
Template:Documentation </noinclude></text>
<sha1>h8s4unutwk14jcbyfcq88r5yvqbu5x5</sha1>
</revision>
</page>
<page>
<title>Template:TranslateThis</title>
<ns>10</ns>
<id>16552759</id>
<revision>
<id>483148362</id>
<parentid>483129342</parentid>
<timestamp>2017-05-08T01:54:31Z</timestamp>
<contributor>
<username>MKar</username>
<id>6110</id>
</contributor>
<minor/>
<comment>Undid revision 483129342 by 70.71.90.6 (talk)</comment>
<origin>483148362</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="97" sha1="rm4lztokzfib496c8sbt9q36vx6n9tz" xml:space="preserve"><includeonly>Script error: No such module "TranslateThis".</includeonly><noinclude>Template:Documentation</noinclude></text>
<sha1>rm4lztokzfib496c8sbt9q36vx6n9tz</sha1>
</revision>
</page>
<page>
<title>Module:TranslateThis</title>
<ns>828</ns>
<id>16552706</id>
<revision>
<id>2144500220</id>
<parentid>1980692436</parentid>
<timestamp>2024-05-04T13:29:50Z</timestamp>
<contributor>
<username>Uzume</username>
<id>11596</id>
</contributor>
<comment>switch frame:preprocess("⧼lang⧽") to callParserFunction("int", "lang")</comment>
<origin>2144500220</origin>
<model>Scribunto</model>
<format>text/plain</format>
<text bytes="1738" sha1="j2it1vjxk477pw54t7yheap3g9xt452" xml:space="preserve">local fb = require('Module:Fallback')
local dir = require('Module:Dir')
return { main = function( frame )
local function shallowcopy(orig) if type(orig) ~= 'table' then return orig end
local result = {} for key, value in pairs(orig) do result[key] = value end return result end
local args = shallowcopy(frame:getParent().args) local lang = args.lang or frame:callParserFunction("int", "lang") -- I don't know of any other way to get the user's language... args.lang = nil
local anchor = args.anchor args.anchor = nil if (anchor and args[anchor]) then anchor = args[anchor] end anchor = anchor and frame:expandTemplate( { title = "Anchor", args = { anchor } } ) or
local result = args[ lang ] if result and result ~= then result = '<span dir="' .. dir.select(lang, 'rtl', 'ltr') .. '" lang="' .. lang .. '">' .. result .. '</span>' else local default = {} for i, v in pairs( args ) do if v ~= "" then table.insert(default, '<span dir="' .. dir.select(i, 'rtl', 'ltr') .. '" lang="' .. i .. '">' .. v .. '</span> <small>(' .. i .. ')</small>') end end default = table.concat(default, ' / ') args.default=default local newlang result, newlang = fb._langSwitch(args, lang) if not newlang then result = elseif newlang~='default' then result = '<span dir="' .. dir.select(newlang, 'rtl', 'ltr') .. '" lang="' .. newlang .. '">' .. result .. '</span> <small>(' .. newlang .. ')</small>' end local langname = mw.language.fetchLanguageName( lang, lang ) if langname ~= "" and newlang then result = result .. " – " .. frame:expandTemplate( { title = "Help translate", args = { langname, lang = lang } } ) end end
return anchor .. result end}</text>
<sha1>j2it1vjxk477pw54t7yheap3g9xt452</sha1>
</revision>
</page>
<page>
<title>Module:Dir</title>
<ns>828</ns>
<id>95388294</id>
<revision>
<id>1935187194</id>
<parentid>1935159027</parentid>
<timestamp>2023-07-15T22:41:28Z</timestamp>
<contributor>
<username>Tacsipacsi</username>
<id>33956</id>
</contributor>
<comment>Undid revision 1935159027 by 177.232.91.83 (talk): test edit</comment>
<origin>1935187194</origin>
<model>Scribunto</model>
<format>text/plain</format>
<text bytes="5612" sha1="n6dnippb8dl8nupbrxgqviac0hno50v" xml:space="preserve">-- This module implements Template:Dir.
-- local rtlOverrides = mw.loadData('Module:Dir/RTL overrides') -- !!! mw.loadData() is currently broken, it does NOT load anything local rtlOverrides = require('Module:Dir/RTL overrides') local p = {}
local function trim(s)
if s and s ~= then s = tostring(s):match('^%s*(.-)%s*$') end
if s == then return nil end
return s
end
function p.rtlLangs(isRTL)
if isRTL == nil then isRTL = true end
return rtlOverrides[isRTL] or {}
end
function p.isRTL(code)
if type(code) ~= 'string' then return nil end
local v = rtlOverrides[code] -- very fast and not limited in the number of supported languages
if v ~= nil then return v end -- return it if mapped, otherwise use MediaWiki library:
local success, ret = pcall(function ()
return mw.language.new(code):isRTL() -- expensive and limited to 20 languages per MediaWiki instance
end)
return success and ret
end
function p.select(code, rtl, ltr)
if p.isRTL(code) then
return rtl
else
return ltr
end
end
-- Used via a template Template:Dir -- which just calls Script error: No such module "Dir"., the 3 parameters are automatically trimmed: -- Parameter 1 takes the default value from ⧼Lang⧽ if it's empty or not specified. -- Parameter 2 can be named rtl, may be explicitly empty, otherwise takes the default value 'rtl' only if it's not specified. -- Parameter 3 can be named ltr, may be explicitly empty, otherwise takes the default value 'ltr' only if it's not specified. function p.main(frame)
local args = frame:getParent().args -- Parameters used to transclude Template:Dir
local code = trim(args[1]) or frame:callParserFunction('Int', 'Lang')
local rtl = trim(args.rtl or args[2] or 'rtl')
local ltr = trim(args.ltr or args[3] or 'ltr')
return p.select(code, rtl, ltr)
end
setmetatable(p, { quickTests = function ()
local rtlLangs = p.rtlLangs(true) local ltrLangs = p.rtlLangs(false)
-- Basic check of data format
local function checkLangs(name, langs)
for k, lang in pairs(langs) do
assert(type(k) == 'number' and k == math.floor(k)
and type(lang) == 'string' and #lang >= 2 and #lang <= 16
and lang:find('^[a-z][%-0-9a-z]*[0-9a-z]$') == 1,
": Invalid sequence of language codes, " .. name .. "['" .. k .. "'] = '" .. lang .. "'")
end
return true
end
local ok, msg
ok, msg = pcall(checkLangs, 'rtlLangs', rtlLangs)
if not ok then return false, msg end
ok, msg = pcall(checkLangs, 'ltrLangs', ltrLangs)
if not ok then return false, msg end
-- Build inverse maps of languages having each direction
local isrtl, isltr = {}, {}
for _, lang in ipairs(rtlLangs) do isrtl[lang] = true end
for _, lang in ipairs(ltrLangs) do isltr[lang] = true end
-- Check conflicts using the two inverse maps
for _, lang in ipairs(rtlLangs) do
if isltr[lang] then return false, ": Direction conflict for '" .. lang .. "'" end
end
for _, lang in ipairs(ltrLangs) do
if isrtl[lang] then return false, ": Direction conflict for '" .. lang .. "'" end
end
-- Log missing languages (allows filling the tables above) according to MediaWiki internal data
local knownLangs, isKnownLang = mw.language.fetchLanguageNames(), {}
for lang, _ in pairs(knownLangs) do
isKnownLang[lang] = true
if rtlOverrides[lang] == nil then -- only if we still don't have data for this language
-- Note: we cannot check more than 20 languages at once, then MediaWiki raises an error.
-- So this test only runs on the Lua console, where you can update the tables at top.
-- This also means we cannot compare what MediaWiki returns with the direction we map here for all languages.
ok, value = pcall(function() return tostring(mw.language.new(lang):isRTL()) end)
mw.log("Warning: missing direction for language '" .. lang .. "', MediaWiki returns '" .. value .. "'")
end
end
-- utility: reverse order iterator on sequences
local function revipairs(t)
return function(t, i)
i = i - 1
local v = t[i]
if v == nil then return nil end
return i, v
end, t, #t + 1
end
-- Sort and deduplicate language code values (by scanning backward) for data cleanup
-- Also log languages having a direction mapping in this module but still not known by MediaWiki
table.sort(rtlLangs)
table.sort(ltrLangs)
for i, lang in revipairs(rtlLangs) do
if rtlLangs[i - 1] == rtlLangs[i] then table.remove(rtlLangs, i) end
if isKnownLang[lang] == nil then
mw.log("RTL language '" .. lang .. "' still not known by Mediawiki (could be a missing alias or variant)")
end
end
for i, lang in revipairs(ltrLangs) do
if ltrLangs[i - 1] == ltrLangs[i] then table.remove(ltrLangs, i) end
if isKnownLang[lang] == nil then
mw.log("LTR language '" .. lang .. "' still not known by Mediawiki (could be a missing alias or variant)")
end
end
-- Final presentation of current lists, sorted and deduplicated
mw.log("----")
mw.log("local rtlLangs = { '" .. table.concat(rtlLangs, "', '") .. "' }")
mw.log("local ltrLangs = { '" .. table.concat(ltrLangs, "', '") .. "' }")
return true
end }) --[==[ Enter this to run tests in the Lua console: =getmetatable(p).quickTests() --]==]
return p</text>
<sha1>n6dnippb8dl8nupbrxgqviac0hno50v</sha1>
</revision>
</page>
<page>
<title>Module:Dir/RTL overrides</title>
<ns>828</ns>
<id>95388411</id>
<revision>
<id>1223091335</id>
<timestamp>2020-07-03T04:07:06Z</timestamp>
<contributor>
<username>Amitie 10g</username>
<id>185006</id>
</contributor>
<comment>Created page with "local p = {} --[==[ Basic input sequences: relative order or duplicates does not matter here (but the end of the self test displays them sorted and deduplicated), but codes m..."</comment>
<origin>1223091335</origin>
<model>Scribunto</model>
<format>text/plain</format>
<text bytes="4566" sha1="cxld5o18iaxkhru8z4aje5lec04qed1" xml:space="preserve">local p = {}
--[==[ Basic input sequences: relative order or duplicates does not matter here (but the end of the self test displays them sorted and deduplicated), but codes must be valid and belong to only one of the two sequences).
Any missing language code will be checked with mw.language.new(code):isRTL(), which is costly in loaded resources (it can only check 20 languages at most including the content language) So it is best to map all languages that are the most likely to be used. --]==]
local rtlLangs = { 'aeb', 'aeb-arab', 'ar', 'arc', 'arq', 'ary', 'arz', 'azb', 'bcc', 'bgn', 'bqi', 'ckb', 'dv', 'fa', 'fa-af', 'glk', 'ha-arab', 'he', 'khw', 'kk-arab', 'kk-cn', 'ks-arab', 'ku-arab', 'lki', 'lrc', 'luz', 'mzn', 'nqo', 'ota', 'pnb', 'prd', 'ps', 'sd', 'sdh', 'skr', 'skr-arab', 'ug', 'ug-arab', 'ur', 'uz-arab', 'ydd', 'yi' }
local ltrLangs = { 'aa', 'ab', 'abs', 'ace', 'ady', 'ady-cyrl', 'aeb-latn', 'af', 'ak', 'aln', 'als', 'alt', 'am', 'ami', 'an', 'ang', 'anp', 'arn', 'as', 'ase', 'ast', 'atj', 'av', 'avk', 'awa', 'ay', 'az', 'ba', 'ban', 'bar', 'bat-smg', 'bbc', 'bbc-latn', 'bcl', 'be', 'be-tarask', 'be-x-old', 'bg', 'bh', 'bho', 'bi', 'bjn', 'bm', 'bn', 'bo', 'bpy', 'br', 'brh', 'bs', 'btm', 'bto', 'bu', 'bug', 'bxr', 'ca', 'cbk-zam', 'cdo', 'ce', 'ceb', 'ch', 'cho', 'chr', 'chy', 'co', 'cop', 'cps', 'cr', 'crh', 'crh-cyrl', 'crh-latn', 'cs', 'csb', 'cu', 'cv', 'cy', 'da', 'de', 'de-at', 'de-ch', 'de-formal', 'din', 'diq', 'dsb', 'dtp', 'dty', 'dz', 'ee', 'egl', 'el', 'eml', 'en', 'en-ca', 'en-gb', 'en-ie', 'en-us', 'eo', 'es', 'es-419', 'es-formal', 'et', 'eu', 'ext', 'ff', 'fi', 'fil', 'fit', 'fiu-vro', 'fj', 'fkv', 'fo', 'fr', 'frc', 'fro', 'frp', 'frr', 'fur', 'fy', 'ga', 'gag', 'gan', 'gan-hans', 'gan-hant', 'gcf', 'gcr', 'gd', 'gl', 'gn', 'gom', 'gom-deva', 'gom-latn', 'gor', 'got', 'grc', 'gsw', 'gu', 'gv', 'ha', 'hak', 'haw', 'hi', 'hif', 'hif-deva', 'hif-latn', 'hil', 'hmn', 'ho', 'hr', 'hrx', 'hsb', 'ht', 'hu', 'hu-formal', 'hy', 'hyw', 'hz', 'ia', 'id', 'ie', 'ig', 'ii', 'ik', 'ike-cans', 'ike-latn', 'ilo', 'inh', 'io', 'is', 'it', 'iu', 'ja', 'jam', 'jbo', 'jut', 'jv', 'ka', 'kaa', 'kab', 'kbd', 'kbd-cyrl', 'kbd-latn', 'kbp', 'kea', 'kg', 'ki', 'kiu', 'kj', 'kjp', 'kk', 'kk-cyrl', 'kk-kz', 'kk-latn', 'kk-tr', 'kl', 'km', 'kn', 'ko', 'ko-kp', 'ko-kr', 'koi', 'kr', 'krc', 'kri', 'krj', 'krl', 'ks', 'ks-deva', 'ksh', 'ku', 'ku-latn', 'kum', 'kv', 'kw', 'ky', 'la', 'lad', 'lb', 'lbe', 'lez', 'lfn', 'lg', 'li', 'lij', 'liv', 'lld', 'lmo', 'ln', 'lo', 'loz', 'lt', 'ltg', 'lus', 'lv', 'lzh', 'lzz', 'mai', 'map-bms', 'mdf', 'mg', 'mh', 'mhr', 'mi', 'min', 'mk', 'ml', 'mn', 'mni', 'mnw', 'mo', 'mr', 'mrj', 'ms', 'mt', 'mus', 'mwl', 'my', 'myv', 'na', 'nah', 'nan', 'nap', 'nb', 'nds', 'nds-nl', 'ne', 'new', 'ng', 'niu', 'nl', 'nl-informal', 'nn', 'no', 'nod', 'non', 'nov', 'nrf', 'nrf-fr', 'nrf-gg', 'nrf-je', 'nrm', 'nso', 'nv', 'ny', 'nys', 'oc', 'olo', 'om', 'or', 'os', 'pa', 'pag', 'pam', 'pap', 'pcd', 'pdc', 'pdt', 'pfl', 'pi', 'pih', 'pl', 'pms', 'pnt', 'prg', 'pt', 'pt-br', 'pt-cv', 'pt-pt', 'qu', 'quc', 'qug', 'rgn', 'rif', 'rm', 'rmf', 'rmy', 'rn', 'ro', 'roa-rup', 'roa-tara', 'ru', 'rue', 'rup', 'ruq', 'ruq-cyrl', 'ruq-latn', 'rw', 'rwr', 'sa', 'sah', 'sat', 'sc', 'scd', 'scn', 'sco', 'sdc', 'se', 'sei', 'ses', 'sg', 'sgs', 'sh', 'sh-cyrl', 'sh-latn', 'shi', 'shi-latn', 'shi-tfng', 'shn', 'shy-latn', 'si', 'simple', 'sjd', 'sje', 'sju', 'sk', 'sl', 'sli', 'sm', 'sma', 'smj', 'smn', 'sms', 'sn', 'so', 'sq', 'sr', 'sr-cyrl', 'sr-ec', 'sr-el', 'sr-latn', 'srn', 'srq', 'ss', 'st', 'stq', 'sty', 'su', 'sv', 'sw', 'szl', 'szy', 'ta', 'tay', 'tcy', 'te', 'tet', 'tg', 'tg-cyrl', 'tg-latn', 'th', 'ti', 'tk', 'tl', 'tly', 'tn', 'to', 'tokipona', 'tpi', 'tr', 'tru', 'trv', 'ts', 'tt', 'tt-cyrl', 'tt-latn', 'tum', 'tw', 'ty', 'tyv', 'tzl', 'tzm', 'udm', 'ug-latn', 'uk', 'uz', 'uz-cyrl', 'uz-latn', 've', 'vec', 'vep', 'vi', 'vls', 'vmf', 'vo', 'vot', 'vro', 'wa', 'war', 'wo', 'wuu', 'xal', 'xh', 'xmf', 'xsy', 'yo', 'yue', 'za', 'zea', 'zgh', 'zh', 'zh-classical', 'zh-cn', 'zh-hans', 'zh-hant', 'zh-hk', 'zh-min-nan', 'zh-mo', 'zh-my', 'zh-sg', 'zh-tw', 'zh-wuu', 'zh-yue', 'zu' }
-- Build the inverted map of languages to direction returned by this data module (fast, but collisions are not checked: run the test module) for _, lang in ipairs(rtlLangs) do p[lang] = true end for _, lang in ipairs(ltrLangs) do p[lang] = false end
-- Also store the two lists (at boolean indice), used by the test module to check the inverted map p[true] = rtlLangs p[false] = ltrLangs
return p</text>
<sha1>cxld5o18iaxkhru8z4aje5lec04qed1</sha1>
</revision>
</page>
<page>
<title>Template:SPARQLText</title>
<ns>10</ns>
<id>23033014</id>
<revision>
<id>1399250943</id>
<parentid>1399250772</parentid>
<timestamp>2021-04-10T14:44:00Z</timestamp>
<contributor>
<ip>87.126.92.234</ip>
</contributor>
<comment>Undid revision 1399250772 by 87.126.92.234 (talk)</comment>
<origin>1399250943</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="340" sha1="f35rnwtdn4sdogbp73jb3irfk0cvqp7" xml:space="preserve">{{#if:|
Template:IfTemplate:IfTemplate:IfTemplate:If }}1 2<noinclude>Template:Doc</noinclude></text>
<sha1>f35rnwtdn4sdogbp73jb3irfk0cvqp7</sha1>
</revision>
</page>
<page>
<title>Template:Int try it</title>
<ns>10</ns>
<id>109708780</id>
<redirect title="Template:Int run it" />
<revision>
<id>1764769125</id>
<timestamp>2022-11-04T21:44:15Z</timestamp>
<contributor>
<username>عُثمان</username>
<id>5050751</id>
</contributor>
<comment>عُثمان moved page Template:Int try it to Template:Int run it: the recent change to run it seems fine, but I was confused about where to find the template since the name did not match - move is inaccordance; redirects should resolve</comment>
<origin>1764769125</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="33" sha1="jwzw36nb8jui2zuk88ncwnse88o65qy" xml:space="preserve">#REDIRECT Template:Int run it</text>
<sha1>jwzw36nb8jui2zuk88ncwnse88o65qy</sha1>
</revision>
</page>
<page>
<title>Module:SPARQLMentions</title>
<ns>828</ns>
<id>28161729</id>
<revision>
<id>1453690994</id>
<parentid>661638891</parentid>
<timestamp>2021-07-04T13:54:47Z</timestamp>
<contributor>
<username>Azertus</username>
<id>1229135</id>
</contributor>
<comment>add getTitle</comment>
<origin>1453690994</origin>
<model>Scribunto</model>
<format>text/plain</format>
<text bytes="2760" sha1="lahzcbsmcekjpuk5o23yy8vvav8qfnz" xml:space="preserve">local p = {}
-- Return the label of a given data item, formatted for linking local function getLabel(frame, id, prefix) if prefix == nil then prefix = end if id == "defaultView:BubbleChart" then id = "Q24515280" end if id == "defaultView:Graph" then id = "Q24515287" end if id == "defaultView:Map" then id = "Q24515275" end
if id == "defaultView:ImageGrid" then id = "Q24515278" end
if id == "wikibase:box" then id = "Q26211169" end if id == "wikibase:cornerWest" then id = "Q26211177" end label = mw.wikibase.label( id ) if label == nil then linktext = id extra = else linktext = label .. " (" .. id .. ")" extra = ' ' .. frame:expandTemplate({ title="Reasonator", args= { [1] = id}}) .. ' ' .. frame:expandTemplate({ title="SQID", args= { [1] = id}}) end
link = mw.wikibase.getEntityUrl( id )
return '[' .. link .. ' ' .. linktext .. ']' .. extra; end
local function map(func, array)
local new_array = {}
for i,v in ipairs(array) do
new_array[i] = func(v)
end
return new_array
end
local function getAll(text, regexp, seen, items) if items == nil then items = {} end if seen == nil then seen = {} end for item in string.gmatch(text, regexp) do if seen[item] == nil then seen[item] = 1 table.insert(items, item) end end return items end
-- Produce list of items mentioned in the query
function p.getItems(frame)
if not mw.wikibase then
return "no mw.wikibase"
end
items = getAll(frame.args[1], 'wd:(Q%d+)') return table.concat(map(function(it) return getLabel(frame, it) end, items), ", ") end
-- Produce list of properties mentioned in the query function p.getProperties(frame) if not mw.wikibase then return "no mw.wikibase" end
seen = {} items = {} prefixes = {'wdt', 'p', 'ps', 'pr', 'pq', 'psv', 'pv', 'prv', 'pqv', 'wdtn', 'psn', 'pqn', 'prn', 'wdno' } for _, pr in ipairs(prefixes) do items = getAll(frame.args[1], pr .. ':(P%d+)', seen, items) end return table.concat(map(function(it) return getLabel(frame, it, 'Property:') end, items), ", ") end
function p.getFunctions(frame) if not mw.wikibase then return "no mw.wikibase" end
seen = {} items = {} func = {'defaultView:BubbleChart', 'defaultView:Graph', 'defaultView:Map', 'defaultView:ImageGrid', 'wikibase:box', "wikibase:cornerWest" } for _, pr in ipairs(func) do items = getAll(frame.args[1], pr, seen, items) end return table.concat(map(function(it) return getLabel(frame, it) end, items), ", ") end
function p.getTitle(frame) if not mw.wikibase then return "no mw.wikibase" end
for line in string.gmatch(frame.args[1], "[^%c]+%c?") do local title = string.match(line, '^#title:%s*([^%c]+)')
if not (title == nil) then return title end end end
return p</text>
<sha1>lahzcbsmcekjpuk5o23yy8vvav8qfnz</sha1>
</revision>
</page>
<page>
<title>Template:SQID</title>
<ns>10</ns>
<id>26259378</id>
<revision>
<id>1233859301</id>
<parentid>1227690908</parentid>
<timestamp>2020-07-18T14:13:28Z</timestamp>
<contributor>
<username>MisterSynergy</username>
<id>44949</id>
</contributor>
<comment>move URL to https://sqid.toolforge.org</comment>
<origin>1233859301</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="993" sha1="j6wq5aq6l7wsi92xtysclan6m8dprov" xml:space="preserve"><!--
-->{{#if: | Template:Q  }}<!-- -->{{#if: | Template:P  }}<!-- -->{{#if: | <span class="plainlinks">[https://sqid.toolforge.org/#{{#if:
| /view?id={{#if:
|
| {{#if:
| Q{{#titleparts:}}
| P{{#titleparts:}}
}}
}}&lang=⧼Lang⧽
| /?lang=⧼Lang⧽
}} ]</span>
}}<!-- --><nowiki/>?lang=⧼Lang⧽ }}<!-- --><noinclude>Template:Documentation</noinclude></text>
<sha1>j6wq5aq6l7wsi92xtysclan6m8dprov</sha1>
</revision>
</page>
<page>
<title>Template:Reasonator</title>
<ns>10</ns>
<id>17365939</id>
<revision>
<id>1556587517</id>
<parentid>1507464031</parentid>
<timestamp>2022-01-05T12:35:07Z</timestamp>
<contributor>
<username>Venca24</username>
<id>103280</id>
</contributor>
<comment>+ cs, eo</comment>
<origin>1556587517</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="882" sha1="ej9pd5v5fuipsemxo8gx8dbsqgg5vij" xml:space="preserve">{{#if:
| <span class="plainlinks">[5]</span> }} Template:TranslateThis<noinclude>Template:Documentation</noinclude></text>
<sha1>ej9pd5v5fuipsemxo8gx8dbsqgg5vij</sha1>
</revision>
</page>
<page>
<title>Template:WikiProject</title>
<ns>10</ns>
<id>21790485</id>
<revision>
<id>2298079997</id>
<parentid>2053606357</parentid>
<timestamp>2025-01-14T09:49:46Z</timestamp>
<contributor>
<username>Mormegil</username>
<id>28758</id>
</contributor>
<comment>+cs</comment>
<origin>2298079997</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="2446" sha1="afrxihplnkiijrydcgi7kwzg00a84sv" xml:space="preserve"><noinclude>Template:Doc</noinclude><!--
-->{{#ifexist: Wikidata:WikiProject <!--
#then:
-->|{{#if:<!--
#then:
-->|Template:Section link<!--
#else:
-->|Template:Ll<!--
-->}}<!--
#else:
-->|{{error<!--
-->|Template:TranslateThis<!--
-->}}<!--
--> <small>Template:TranslateThis<!--
--></small><!--
-->}}</text>
<sha1>afrxihplnkiijrydcgi7kwzg00a84sv</sha1>
</revision>
</page>
<page>
<title>Template:WikiProject/pagename</title>
<ns>10</ns>
<id>22491841</id>
<revision>
<id>1294585707</id>
<parentid>238479307</parentid>
<timestamp>2020-10-19T21:05:53Z</timestamp>
<contributor>
<username>Tacsipacsi</username>
<id>33956</id>
</contributor>
<comment>substitute template that doesn’t do what its name suggests and what it does in other projects</comment>
<origin>1294585707</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="60" sha1="8o2k69wu2sme8f490aakwi7ynj63jjv" xml:space="preserve">{{#if:|Wikidata Talk|Wikidata}}:WikiProject {{{1}}}</text>
<sha1>8o2k69wu2sme8f490aakwi7ynj63jjv</sha1>
</revision>
</page>
<page>
<title>Template:ItemOrNot</title>
<ns>10</ns>
<id>28161695</id>
<revision>
<id>361346548</id>
<parentid>361300782</parentid>
<timestamp>2016-08-02T21:22:10Z</timestamp>
<contributor>
<username>Smalyshev (WMF)</username>
<id>1482806</id>
</contributor>
<origin>361346548</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="384" sha1="230nkvb4w9pmw09vu3optxajqkjdr42" xml:space="preserve">{{#if: | * {{{1}}}: | }}<noinclude>
<templatedata> { "params": { "1": { "label": "List item name", "type": "string", "required": true }, "2": { "description": "List item contents", "type": "string" } }, "description": "Displays list item if second argument is not empty, otherwise nothing", "format": "block" } </templatedata> </noinclude></text>
<sha1>230nkvb4w9pmw09vu3optxajqkjdr42</sha1>
</revision>
</page>
<page>
<title>Template:Int Properties</title>
<ns>10</ns>
<id>25945270</id>
<revision>
<id>360948553</id>
<parentid>360948486</parentid>
<timestamp>2016-07-31T15:39:37Z</timestamp>
<contributor>
<username>Airon90</username>
<id>4782</id>
</contributor>
<origin>360948553</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="63" sha1="1f6bvc59pk8lngjngkff5ej07hrd17a" xml:space="preserve"><noinclude>Template:Doc</noinclude>Template:Capitalize</text>
<sha1>1f6bvc59pk8lngjngkff5ej07hrd17a</sha1>
</revision>
</page>
<page>
<title>Template:Int properties</title>
<ns>10</ns>
<id>25941214</id>
<revision>
<id>2504115378</id>
<parentid>2438818739</parentid>
<timestamp>2026-06-10T11:28:12Z</timestamp>
<contributor>
<username>مواطن تونسي</username>
<id>1537128</id>
</contributor>
<minor/>
<comment>traduction ar</comment>
<origin>2504115378</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="746" sha1="ao6colplfei84pspf07jmngpp7arssr" xml:space="preserve"><noinclude>Template:Doc</noinclude>Template:TranslateThis</text>
<sha1>ao6colplfei84pspf07jmngpp7arssr</sha1>
</revision>
</page>
<page>
<title>Template:SPARQL2/doc</title>
<ns>10</ns>
<id>35750675</id>
<revision>
<id>1425856775</id>
<parentid>1425856600</parentid>
<timestamp>2021-05-21T17:39:04Z</timestamp>
<contributor>
<username>PAC2</username>
<id>4892</id>
</contributor>
<comment>/* See also */ typo</comment>
<origin>1425856775</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="533" sha1="p2irk8qhdq7sqdc2n9kyjs3lvi2j5kw" xml:space="preserve"><nowiki>Template loop detected: Template:SPARQL2</nowiki>
Template loop detected: Template:SPARQL2
<nowiki>Template loop detected: Template:SPARQL2</nowiki>
Template loop detected: Template:SPARQL2
<nowiki>Template loop detected: Template:SPARQL2</nowiki>
Template loop detected: Template:SPARQL2
<nowiki>Template loop detected: Template:SPARQL2</nowiki>
Template loop detected: Template:SPARQL2
See also
<sha1>p2irk8qhdq7sqdc2n9kyjs3lvi2j5kw</sha1>
</revision>
</page>
<page>
<title>Template:Int run it</title>
<ns>10</ns>
<id>25022557</id>
<revision>
<id>2438820809</id>
<parentid>2033139854</parentid>
<timestamp>2025-12-06T14:46:20Z</timestamp>
<contributor>
<username>YeBoy371</username>
<id>2200680</id>
</contributor>
<origin>2438820809</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="1085" sha1="8ggotttekjqxrksv8jgpqj8yv3lzvla" xml:space="preserve"><noinclude>Template:Doc</noinclude>Template:TranslateThis</text>
<sha1>8ggotttekjqxrksv8jgpqj8yv3lzvla</sha1>
</revision>
</page>
</mediawiki>
<nowiki><mediawiki xmlns="http://www.mediawiki.org/xml/export-0.11/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.11/ http://www.mediawiki.org/xml/export-0.11.xsd" version="0.11" xml:lang="en">
<siteinfo> <sitename>Wikidata</sitename> <dbname>wikidatawiki</dbname> <base>https://www.wikidata.org/wiki/Wikidata:Main_Page</base> <generator>MediaWiki 1.47.0-wmf.17</generator> <case>first-letter</case> <namespaces> <namespace key="-2" case="first-letter">Media</namespace> <namespace key="-1" case="first-letter">Special</namespace> <namespace key="0" case="first-letter" /> <namespace key="1" case="first-letter">Talk</namespace> <namespace key="2" case="first-letter">User</namespace> <namespace key="3" case="first-letter">User talk</namespace> <namespace key="4" case="first-letter">Wikidata</namespace> <namespace key="5" case="first-letter">Wikidata talk</namespace> <namespace key="6" case="first-letter">File</namespace> <namespace key="7" case="first-letter">File talk</namespace> <namespace key="8" case="first-letter">MediaWiki</namespace> <namespace key="9" case="first-letter">MediaWiki talk</namespace> <namespace key="10" case="first-letter">Template</namespace> <namespace key="11" case="first-letter">Template talk</namespace> <namespace key="12" case="first-letter">Help</namespace> <namespace key="13" case="first-letter">Help talk</namespace> <namespace key="14" case="first-letter">Category</namespace> <namespace key="15" case="first-letter">Category talk</namespace> <namespace key="120" case="first-letter">Property</namespace> <namespace key="121" case="first-letter">Property talk</namespace> <namespace key="122" case="first-letter">Query</namespace> <namespace key="123" case="first-letter">Query talk</namespace> <namespace key="146" case="first-letter">Lexeme</namespace> <namespace key="147" case="first-letter">Lexeme talk</namespace> <namespace key="640" case="first-letter">EntitySchema</namespace> <namespace key="641" case="first-letter">EntitySchema talk</namespace> <namespace key="710" case="first-letter">TimedText</namespace> <namespace key="711" case="first-letter">TimedText talk</namespace> <namespace key="828" case="first-letter">Module</namespace> <namespace key="829" case="first-letter">Module talk</namespace> <namespace key="1198" case="first-letter">Translations</namespace> <namespace key="1199" case="first-letter">Translations talk</namespace> <namespace key="1728" case="first-letter">Event</namespace> <namespace key="1729" case="first-letter">Event talk</namespace> <namespace key="2600" case="first-letter">Topic</namespace> </namespaces> </siteinfo> <page> <title>Template:SPARQL2</title> <ns>10</ns> <id>28161690</id> <revision> <id>2346047691</id> <parentid>2346040648</parentid> <timestamp>2025-05-08T12:02:25Z</timestamp> <contributor> <username>Madamebiblio</username> <id>2952832</id> </contributor> <minor/> <comment>Reverted edits by 201.143.205.181 (talk) to last revision by Kokage si</comment> <origin>2294596805</origin> <model>wikitext</model> <format>text/x-wiki</format> <text bytes="7567" sha1="s4975lvx7s2i4pjji1govtxccu2rt3e" xml:space="preserve">Template:SPARQL2/doc
<onlyinclude>Template:Clear{{#ifeq:test|test| <!--hidden hints--> | {{TranslateThis<!--
-->|ar=يستخدم الاستعلام التالي هذه:<!--
-->|be-tarask=Дадзены запыт выкарыстоўвае:<!--
-->|cs=Následující dotaz používá:<!--
-->|de=Die Suchanfrage verwendet:<!--
-->|en=The following query uses these:<!--
-->|en-gb=The following query uses these:<!--
-->|el=Το ακόλουθο ερώτημα χρησιμοποιεί αυτά:<!--
-->|es=La siguiente consulta utiliza lo siguiente:<!--
-->|fi=Seuraava kysely käyttää näitä:<!--
-->|fr=La requête suivante utilise ces :<!--
-->|hu=Ez a lekérdezés a következőket használja:<!--
-->|id=Kueri di bawah akan menggunakan entitas berikut:<!--
-->|it=La seguente query utilizza questi:<!--
-->|ja=以下のクエリではこれらを使用します:<!--
-->|nl=Deze query gebruikt:<!--
-->|pl=To zapytanie używa:<!--
-->|pt=A consulta seguinte utiliza estes:<!--
-->|pt-br=A consulta seguinte utiliza estes:<!--
-->|ru=Этот запрос использует:<!--
-->|sv=Följande fråga använder dessa:<!--
-->|tr=Aşağıdaki sorgu bunları kullanıyor:<!--
-->|uk=Цей запит використовує:<!--
-->}}<!-- -->Template:ItemOrNot <!-- -->Template:ItemOrNot <!-- -->Template:ItemOrNot <!--
-->}}
[[:Template:SPARQLText]]
<!-- --><div class="displayonly">{{#if: ||Template:Int try it}}</div>Template:Clear</onlyinclude><noinclude> <templatedata> { "params": { "query": { "required": true, "label": { "ar": "استعلام", "be-tarask": "запыт", "cs": "dotaz", "en": "query", "es": "consulta", "fr": "requête", "id": "kueri", "it": "query", "ja": "クエリ", "pl": "zapytanie", "pt": "consulta", "pt-br": "consulta", "sv": "fråga",
"tr": "sorgu",
"uk": "запит" }, "description": { "ar": "استعلام سباركل", "be-tarask": "запыт SPARQL", "cs": "SPARQL dotaz", "en": "SPARQL query", "es": "consulta SPARQL", "fr": "la requête que le modèle doit traiter et afficher", "id": "kueri SPARQL", "it": "query SPARQL", "ja": "SPARQLクエリ", "pl": "query SPARQL", "pt": "consulta SPARQL", "pt-br": "consulta SPARQL", "sv": "SPARQL fråga", "tr": "SPARQL sorgusu", "uk": "запит SPARQL" }, "example": { "be-tarask": "SELECT * WHERE { ?x wdt:P31 wd:Q5 } LIMIT 1", "cs": "SELECT * WHERE { ?x wdt:P31 wd:Q5 } LIMIT 1", "en": "SELECT * WHERE { ?x wdt:P31 wd:Q5 } LIMIT 1", "es": "SELECT ?item WHERE { ?item wdt:P31 wd:Q5 } LIMIT 1", "fr": "select ?item where { ?item wdt:P31 wd:Q5 } LIMIT 1", "id": "SELECT * WHERE { ?a wdt:P31 wd:Q5 } LIMIT 1", "it": "select ?item where { ?item wdt:P31 wd:Q5 } LIMIT 1", "pt": "select ?item where { ?item wdt:P31 wd:Q5 } LIMIT 1", "pt-br": "select ?item where { ?item wdt:P31 wd:Q5 } LIMIT 1" }, "type": "string", "aliases": [ "sparql" ], "suggested": true }, "extraprefix": { "description": { "ar": "بادئات إضافية لإضافتها",
"be-tarask": "дадатковыя прэфіксы (неабавязковыя)",
"cs": "Dodatečné prefixy (volitelné)", "en": "Extra prefixes to be added", "es": "Prefijos extra a añadir (opcional)", "fr": "les préfixes SPARQL non standards ou inconnus du service de requête éventuellement nécessaires (optionnel)", "id": "Prefiks SPARQL yang akan ditambahkan", "it": "Aggiungere i prefissi SPARQL non standard o sconosciuti eventualmente necessari (opzionale)", "ja": "追加する接頭辞(オプション)", "pl": "Dodatkowe prefiksy (opcjonalnie)", "pt": "Adicionar os prefixos SPARQL não padrões ou desconhecidos eventualmente necessários (opcional)", "pt-br": "Adicionar os prefixos SPARQL não padrões ou desconhecidos eventualmente necessários (opcional)", "uk": "Додаткові префікси (необов'язкові)" }, "example": "PREFIX wikibase: <http://wikiba.se/ontology#>", "type": "string" } }, "description": {
"be-tarask": "Гэты шаблён выводзіць запыт SPARQL з падсьветкай сынтаксісу, выкарыстаных элемэнтаў і спасылак на WDQS дзеля запуску запыту. \nЗРАБІЦЬ: скарыстаныя меткі элемэнтаў не лякалізаваныя",
"cs": "Tato šablona zobrazuje SPARQL dotaz ze zvýrazněnou syntaxí, použité položky a odkaz na WDQS dotazovací službu pro vyzkoušení.", "en": "This template displays SPARQL query with syntax highlighting, used items and link to WDQS query site to run the query. \nTODO: used items labels are not localized", "es": "Esta plantilla muestra una consulta SPARQL con resaltado de sintaxis, los items utilizados y un enlace al WDQS para lanzar la consulta", "fr": "Ce modèle affiche une requête SPARQL et permet de la lancer au travers du service de requête Wikidata. Il affiche aussi quelques informations basiques sur les éléments et fonctionnalités utilisées par cette requête", "id": "Templat ini menampilkan kueri SPARQL dengan pembedaan warna pada sintaks beserta entitas Wikidata yang digunakan dan pranala kueri di WDQS.", "it": "Questo template mostra una query SPARQL evidenziandone la sintassi e gli elementi usati e fornisce un link alla query WDQS site che permette di lanciare la query", "ja": "このテンプレートは構文強調付きのSPARQLクエリ、使用した項目、クエリを実行するWDQSクエリサイトへのリンクを表示します。", "pl": "Szablon wyświetla zapytanie SPARQL z podświetlaniem składni, listą użytych elementów i linkiem do WDQS.", "pt": "Esta predefinição mostra uma consulta SPARQL na qual evidencia a sintaxe e os elementos usados e fornece um enlace ao site WDQS que permite executar a consulta", "pt-br": "Esta predefinição mostra uma consulta SPARQL na qual evidencia a sintaxe e os elementos usados e fornece um enlace ao site WDQS que permite executar a consulta", "sv": "Denna mall visar en SPARQL fråga med syntaxfärgning, använda objekt och länk till WDQS frågesajten för att köra frågan. \nTODO: använda objekts etiketter är inte lokaliserade", "uk": "Цей шаблон показує запит SPARQL з підсвічуванням елементів синтаксису, список використаних елементів і посилання на сайт WDQS-запиту." }, "paramOrder": [ "query", "extraprefix" ], "format": "block" } </templatedata> </noinclude></text>
<sha1>s4975lvx7s2i4pjji1govtxccu2rt3e</sha1>
</revision>
</page>
<page>
<title>Template:Template</title>
<ns>10</ns>
<id>12414</id>
<redirect title="Template:Tl" />
<revision>
<id>431881</id>
<parentid>312894</parentid>
<timestamp>2012-11-13T02:07:50Z</timestamp>
<contributor>
<username>~riley</username>
<id>2219</id>
</contributor>
<comment>http://en.wikipedia.org/w/index.php?title=Template:Template&action=edit</comment>
<origin>431881</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="25" sha1="cdpzj9yp99pn5v093b404f4sc7cybv1" xml:space="preserve">#REDIRECT Template:Tl</text>
<sha1>cdpzj9yp99pn5v093b404f4sc7cybv1</sha1>
</revision>
</page>
<page>
<title>Template:Tl</title>
<ns>10</ns>
<id>3170</id>
<revision>
<id>2508986920</id>
<parentid>1946850712</parentid>
<timestamp>2026-06-22T01:25:21Z</timestamp>
<contributor>
<username>RogueScholar</username>
<id>3003918</id>
</contributor>
<minor/>
<comment>Format template code for readability and convert numeric HTML entities to named equivalents to accomplish the same</comment>
<origin>2508986920</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="1299" sha1="dqel96mgakegupz568kpnt91rdib9m4" xml:space="preserve"><includeonly><code>{{{{#if:|subst:}}<!-- Begin evaluation of first parameter.
-->{{#ifeq:{|:|:[[]]|<!-- If already prefixed by colon, show the link as such, too.
-->{{#switch:<!-- Target's namespace determines the link format. -->
| | Template = [[Template:|]]<!-- Main: (absent) or Template: namespaces -->
| File | Category = [[:{{{1}}}]]<!-- File and Category namespaces receive hidden colon prefix. -->
| #default = [[{{{1}}}]]<!-- All others are linked verbatim.
-->}}<!-- End of switch function. -->}}<!-- End of first parameter evaluation.
-->{{#ifeq: {{{2}}}| x||{{{2}}}}}<!--
-->{{#ifeq: {{{3}}}| x||{{{3}}}}}<!--
-->{{#ifeq: {{{4}}}| x||{{{4}}}}}<!--
-->{{#ifeq: {{{5}}}| x||{{{5}}}}}<!--
-->{{#ifeq: {{{6}}}| x||{{{6}}}}}<!--
-->{{#ifeq: {{{7}}}| x||{{{7}}}}}<!--
-->{{#ifeq: {{{8}}}| x||{{{8}}}}}<!--
-->{{#ifeq: {{{9}}}| x||{{{9}}}}}<!--
-->{{#ifeq:{{{10}}}|x||{{{10}}}}}}}</code></includeonly><noinclude>
Template:Documentation</noinclude></text>
<sha1>dqel96mgakegupz568kpnt91rdib9m4</sha1>
</revision>
</page>
<page>
<title>Template:Capitalize</title>
<ns>10</ns>
<id>24835143</id>
<revision>
<id>2283223741</id>
<parentid>2282968755</parentid>
<timestamp>2024-12-03T22:55:49Z</timestamp>
<contributor>
<username>Tacsipacsi</username>
<id>33956</id>
</contributor>
<comment>Undid revision 2282968755 by 2806:2F0:A080:F124:78E9:9300:6983:EA83 (talk): ???</comment>
<origin>2283223741</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="100" sha1="08bgnnmlolmwjwag381zkq615fl2s0a" xml:space="preserve"><includeonly>Script error: No such module "Capitalize".</includeonly><noinclude>
Template:Doc </noinclude></text>
<sha1>08bgnnmlolmwjwag381zkq615fl2s0a</sha1>
</revision>
</page>
<page>
<title>Template:Int items</title>
<ns>10</ns>
<id>28641837</id>
<revision>
<id>2438810545</id>
<parentid>2208740771</parentid>
<timestamp>2025-12-06T14:15:50Z</timestamp>
<contributor>
<username>YeBoy371</username>
<id>2200680</id>
</contributor>
<origin>2438810545</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="475" sha1="knyh87z85w0os01yxpmvrzvlnwf07fb" xml:space="preserve"><noinclude>Template:Doc</noinclude>Template:TranslateThis</text>
<sha1>knyh87z85w0os01yxpmvrzvlnwf07fb</sha1>
</revision>
</page>
<page>
<title>Module:Capitalize</title>
<ns>828</ns>
<id>25940912</id>
<revision>
<id>333880118</id>
<parentid>327538585</parentid>
<timestamp>2016-05-08T21:08:10Z</timestamp>
<contributor>
<username>TomT0m</username>
<id>7333</id>
</contributor>
<comment>cap after the tags</comment>
<origin>333880118</origin>
<model>Scribunto</model>
<format>text/plain</format>
<text bytes="518" sha1="oi3oo9q42s5okxrm5hbfy01zk32pehp" xml:space="preserve">
local p = {}
function p.cap(str) lang = mw.getContentLanguage() if lang:ucfirst(str) ~= str then return lang:ucfirst(str) else local substr = mw.ustring.sub b, e = mw.ustring.find(str, ">%s*%a") while e ~= nil do if mw.ustring.find(">", substr(str, b,e)) == nil then return substr(str, 1, e-1) .. lang:ucfirst(substr(str,e,e)) ..substr(str, e+1) end b, e = mw.ustring.find(str, ">%s*%a", e) end return str end end
function p.capitalize(frame) return p.cap(frame.args[1]) end
return p</text>
<sha1>oi3oo9q42s5okxrm5hbfy01zk32pehp</sha1>
</revision>
</page>
<page>
<title>Template:Clear</title>
<ns>10</ns>
<id>12131100</id>
<revision>
<id>665474881</id>
<parentid>91992232</parentid>
<timestamp>2018-04-14T18:59:12Z</timestamp>
<contributor>
<username>Dataeast0000001</username>
<id>2952466</id>
</contributor>
<comment>move onlyinclude to noinclude</comment>
<origin>665474881</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="79" sha1="5aa2j06l3n3husy1g6jggf6oznzocau" xml:space="preserve"><div style="clear:both;"></div><noinclude>Template:Documentation</noinclude></text>
<sha1>5aa2j06l3n3husy1g6jggf6oznzocau</sha1>
</revision>
</page>
<page>
<title>Module:Fallback</title>
<ns>828</ns>
<id>19181086</id>
<revision>
<id>714642825</id>
<parentid>714642495</parentid>
<timestamp>2018-07-23T16:35:03Z</timestamp>
<contributor>
<username>Matěj Suchánek</username>
<id>53613</id>
</contributor>
<minor/>
<comment>fix</comment>
<origin>714642825</origin>
<model>Scribunto</model>
<format>text/plain</format>
<text bytes="5559" sha1="6vr2in87podxnsj3x2jttt1r1qisf9q" xml:space="preserve">local p = {}
function p.fblist(lang, langonly) -- list the full fallback chain from a language to en local fbtable = mw.language.getFallbacksFor(lang) table.insert(fbtable, 1, lang) if not langonly then table.insert(fbtable, 'message') table.insert(fbtable, 'item') table.insert(fbtable, 'default') end return fbtable end
function p._langSwitch(args, lang) -- args: table of translations -- Return error if there is not default and no English version -- otherwise returns the message in the most appropriate, plus the lang code as a second value if not args.en and not args.default and not args.message and not args.item and args.nocat ~= '1' then return error("langSwitch error: no default") end -- get language (either stated one or user's default language) if not lang then return '<strong class="error">LangSwitch Error: no lang</strong>' -- must become proper error end -- get the list of acceptable language (lang + those in lang's fallback chain) and check their content for i, j in ipairs(p.fblist(lang)) do if args[j] then if args[j] == '~' then return nil, j end if j == 'item' then local label, lang = mw.wikibase.getLabelWithLang(args[j]) if label then return label, lang else return args[j], 'en' end end if j == 'message' then return tostring(mw.message.new(args[j]):inLanguage(lang)) end -- if this is an interface message if args[j] ~= then return args[j], j end end end return nil end
function p.langSwitch(frame) -- version to be used from wikitext local args = frame.args -- if no expected args provided than check parent template/module args if not args.en and not args.default and not args.nocat then args = frame:getParent().args end local lang if args.lang and args.lang ~= then lang = args.lang args.lang = nil else -- get user's chosen language lang = frame:preprocess( "⧼lang⧽" ) end local str, language = p._langSwitch(args, lang) return str -- get the first value of the langSwitch, (the text) not the second (the language) end
function p.fallbackpage(base, lang, formatting) local languages = p.fblist(lang) for i, lng in ipairs(languages) do if mw.title.new(base .. '/' .. lng).exists then if formatting == 'table' then return {base .. '/' .. lng, lng} -- returns name of the page + name of the language else return base .. '/' .. lng -- returns only the page end end end return base end
function p.autotranslate(frame) -- logic for template:Autotranslate local args = frame.args if not args.lang or args.lang == then args.lang = frame:preprocess( "⧼lang⧽" ) -- get user's chosen language end
-- find base page local base = args.base if not base or base == then return '<strong class="error">Base page not provided for autotranslate</strong>' end if string.sub(base, 2, 9) ~= 'emplate:' then base = 'Template:' .. base -- base provided without 'Template:' part end
-- find base template language subpage local page = p.fallbackpage(base, args.lang) -- if (not page and base ~= args.base) then -- try the original args.base string. This case is only needed if base is not in template namespace page = p.fallbackpage(args.base, args.lang) end if not page then return string.format('<strong class="error">no fallback page found for autotranslate (base=%s, lang=%s)</strong>', args.base, args.lang) end
-- repack args in a standard table local newargs = {} for field, value in pairs(args) do if field ~= 'base' then newargs[field] = value end end
-- Transclude Template:Page with template arguments the same as the ones passed to Template:Autotranslate template. return frame:expandTemplate{ title = page, args = newargs } end
function p.translate(page, key, lang) --translate data stored in a module if type(page) == 'string' then -- if the requested translation table is not yet loaded page = require('Module:' .. page) end
local val if page[key] then val = page[key] elseif page.keys and page.keys[key] then-- key 'keys" is an index of all keys, including redirects, see Module:i18n/datatype val = page.keys[key] end if not val then return '<' .. key .. '>' end return p._langSwitch(val, lang) end
function p.translatelua(frame) local lang = frame.args.lang local page = require('Module:' .. mw.text.trim(frame.args[1])) -- page should only contain a simple of translations if not lang or mw.text.trim(lang) == then lang = frame:preprocess( "⧼lang⧽" ) end if frame.args[2] then page = page[mw.text.trim(frame.args[2])] end return p._langSwitch(page, lang) end
function p.runTests() local toFallbackTest = require('Module:Fallback/tests/fallbacks') local result = true
mw.log('Testing fallback chains') for i, t in ipairs(toFallbackTest) do local fbtbl = table.concat(p.fblist(t.initial), ', ') local expected = table.concat(t.expected, ', ') local ret = (fbtbl == expected) mw.log(i, ret and 'passed' or 'FAILED', t.initial, (not ret) and ('FAILED\nis >>' .. fbtbl .. '<<\nbut should be >>' .. expected .. '<<\n') or ) result = result and ret end
return result end
function p.showTemplateArguments(frame) -- list all input arguments of the template that calls "Script error: No such module "Fallback"." local str = for name, value in pairs( frame:getParent().args ) do if str == then str = string.format('%s=%s', name, value) -- argument #1 else str = string.format('%s, %s=%s', str, name, value) -- the rest end end return str end
return p</text>
<sha1>6vr2in87podxnsj3x2jttt1r1qisf9q</sha1>
</revision>
</page>
<page>
<title>Template:Ll</title>
<ns>10</ns>
<id>3264473</id>
<revision>
<id>618665821</id>
<parentid>443393354</parentid>
<timestamp>2018-01-11T02:59:59Z</timestamp>
<contributor>
<username>Jarekt</username>
<id>1274</id>
</contributor>
<comment>Fulfilling edit request by User:Kaganer. Thanks for helping!</comment>
<origin>618665821</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="178" sha1="h8s4unutwk14jcbyfcq88r5yvqbu5x5" xml:space="preserve">[[Special:MyLanguage/{{{1}}}{{#if:|#{{{anchor}}}}}|Template:PDT</includeonly>]]<noinclude>
Template:Documentation </noinclude></text>
<sha1>h8s4unutwk14jcbyfcq88r5yvqbu5x5</sha1>
</revision>
</page>
<page>
<title>Template:TranslateThis</title>
<ns>10</ns>
<id>16552759</id>
<revision>
<id>483148362</id>
<parentid>483129342</parentid>
<timestamp>2017-05-08T01:54:31Z</timestamp>
<contributor>
<username>MKar</username>
<id>6110</id>
</contributor>
<minor/>
<comment>Undid revision 483129342 by 70.71.90.6 (talk)</comment>
<origin>483148362</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="97" sha1="rm4lztokzfib496c8sbt9q36vx6n9tz" xml:space="preserve"><includeonly>Script error: No such module "TranslateThis".</includeonly><noinclude>Template:Documentation</noinclude></text>
<sha1>rm4lztokzfib496c8sbt9q36vx6n9tz</sha1>
</revision>
</page>
<page>
<title>Module:TranslateThis</title>
<ns>828</ns>
<id>16552706</id>
<revision>
<id>2144500220</id>
<parentid>1980692436</parentid>
<timestamp>2024-05-04T13:29:50Z</timestamp>
<contributor>
<username>Uzume</username>
<id>11596</id>
</contributor>
<comment>switch frame:preprocess("⧼lang⧽") to callParserFunction("int", "lang")</comment>
<origin>2144500220</origin>
<model>Scribunto</model>
<format>text/plain</format>
<text bytes="1738" sha1="j2it1vjxk477pw54t7yheap3g9xt452" xml:space="preserve">local fb = require('Module:Fallback')
local dir = require('Module:Dir')
return { main = function( frame )
local function shallowcopy(orig) if type(orig) ~= 'table' then return orig end
local result = {} for key, value in pairs(orig) do result[key] = value end return result end
local args = shallowcopy(frame:getParent().args) local lang = args.lang or frame:callParserFunction("int", "lang") -- I don't know of any other way to get the user's language... args.lang = nil
local anchor = args.anchor args.anchor = nil if (anchor and args[anchor]) then anchor = args[anchor] end anchor = anchor and frame:expandTemplate( { title = "Anchor", args = { anchor } } ) or
local result = args[ lang ] if result and result ~= then result = '<span dir="' .. dir.select(lang, 'rtl', 'ltr') .. '" lang="' .. lang .. '">' .. result .. '</span>' else local default = {} for i, v in pairs( args ) do if v ~= "" then table.insert(default, '<span dir="' .. dir.select(i, 'rtl', 'ltr') .. '" lang="' .. i .. '">' .. v .. '</span> <small>(' .. i .. ')</small>') end end default = table.concat(default, ' / ') args.default=default local newlang result, newlang = fb._langSwitch(args, lang) if not newlang then result = elseif newlang~='default' then result = '<span dir="' .. dir.select(newlang, 'rtl', 'ltr') .. '" lang="' .. newlang .. '">' .. result .. '</span> <small>(' .. newlang .. ')</small>' end local langname = mw.language.fetchLanguageName( lang, lang ) if langname ~= "" and newlang then result = result .. " – " .. frame:expandTemplate( { title = "Help translate", args = { langname, lang = lang } } ) end end
return anchor .. result end}</text>
<sha1>j2it1vjxk477pw54t7yheap3g9xt452</sha1>
</revision>
</page>
<page>
<title>Module:Dir</title>
<ns>828</ns>
<id>95388294</id>
<revision>
<id>1935187194</id>
<parentid>1935159027</parentid>
<timestamp>2023-07-15T22:41:28Z</timestamp>
<contributor>
<username>Tacsipacsi</username>
<id>33956</id>
</contributor>
<comment>Undid revision 1935159027 by 177.232.91.83 (talk): test edit</comment>
<origin>1935187194</origin>
<model>Scribunto</model>
<format>text/plain</format>
<text bytes="5612" sha1="n6dnippb8dl8nupbrxgqviac0hno50v" xml:space="preserve">-- This module implements Template:Dir.
-- local rtlOverrides = mw.loadData('Module:Dir/RTL overrides') -- !!! mw.loadData() is currently broken, it does NOT load anything local rtlOverrides = require('Module:Dir/RTL overrides') local p = {}
local function trim(s)
if s and s ~= then s = tostring(s):match('^%s*(.-)%s*$') end
if s == then return nil end
return s
end
function p.rtlLangs(isRTL)
if isRTL == nil then isRTL = true end
return rtlOverrides[isRTL] or {}
end
function p.isRTL(code)
if type(code) ~= 'string' then return nil end
local v = rtlOverrides[code] -- very fast and not limited in the number of supported languages
if v ~= nil then return v end -- return it if mapped, otherwise use MediaWiki library:
local success, ret = pcall(function ()
return mw.language.new(code):isRTL() -- expensive and limited to 20 languages per MediaWiki instance
end)
return success and ret
end
function p.select(code, rtl, ltr)
if p.isRTL(code) then
return rtl
else
return ltr
end
end
-- Used via a template Template:Dir -- which just calls Script error: No such module "Dir"., the 3 parameters are automatically trimmed: -- Parameter 1 takes the default value from ⧼Lang⧽ if it's empty or not specified. -- Parameter 2 can be named rtl, may be explicitly empty, otherwise takes the default value 'rtl' only if it's not specified. -- Parameter 3 can be named ltr, may be explicitly empty, otherwise takes the default value 'ltr' only if it's not specified. function p.main(frame)
local args = frame:getParent().args -- Parameters used to transclude Template:Dir
local code = trim(args[1]) or frame:callParserFunction('Int', 'Lang')
local rtl = trim(args.rtl or args[2] or 'rtl')
local ltr = trim(args.ltr or args[3] or 'ltr')
return p.select(code, rtl, ltr)
end
setmetatable(p, { quickTests = function ()
local rtlLangs = p.rtlLangs(true) local ltrLangs = p.rtlLangs(false)
-- Basic check of data format
local function checkLangs(name, langs)
for k, lang in pairs(langs) do
assert(type(k) == 'number' and k == math.floor(k)
and type(lang) == 'string' and #lang >= 2 and #lang <= 16
and lang:find('^[a-z][%-0-9a-z]*[0-9a-z]$') == 1,
": Invalid sequence of language codes, " .. name .. "['" .. k .. "'] = '" .. lang .. "'")
end
return true
end
local ok, msg
ok, msg = pcall(checkLangs, 'rtlLangs', rtlLangs)
if not ok then return false, msg end
ok, msg = pcall(checkLangs, 'ltrLangs', ltrLangs)
if not ok then return false, msg end
-- Build inverse maps of languages having each direction
local isrtl, isltr = {}, {}
for _, lang in ipairs(rtlLangs) do isrtl[lang] = true end
for _, lang in ipairs(ltrLangs) do isltr[lang] = true end
-- Check conflicts using the two inverse maps
for _, lang in ipairs(rtlLangs) do
if isltr[lang] then return false, ": Direction conflict for '" .. lang .. "'" end
end
for _, lang in ipairs(ltrLangs) do
if isrtl[lang] then return false, ": Direction conflict for '" .. lang .. "'" end
end
-- Log missing languages (allows filling the tables above) according to MediaWiki internal data
local knownLangs, isKnownLang = mw.language.fetchLanguageNames(), {}
for lang, _ in pairs(knownLangs) do
isKnownLang[lang] = true
if rtlOverrides[lang] == nil then -- only if we still don't have data for this language
-- Note: we cannot check more than 20 languages at once, then MediaWiki raises an error.
-- So this test only runs on the Lua console, where you can update the tables at top.
-- This also means we cannot compare what MediaWiki returns with the direction we map here for all languages.
ok, value = pcall(function() return tostring(mw.language.new(lang):isRTL()) end)
mw.log("Warning: missing direction for language '" .. lang .. "', MediaWiki returns '" .. value .. "'")
end
end
-- utility: reverse order iterator on sequences
local function revipairs(t)
return function(t, i)
i = i - 1
local v = t[i]
if v == nil then return nil end
return i, v
end, t, #t + 1
end
-- Sort and deduplicate language code values (by scanning backward) for data cleanup
-- Also log languages having a direction mapping in this module but still not known by MediaWiki
table.sort(rtlLangs)
table.sort(ltrLangs)
for i, lang in revipairs(rtlLangs) do
if rtlLangs[i - 1] == rtlLangs[i] then table.remove(rtlLangs, i) end
if isKnownLang[lang] == nil then
mw.log("RTL language '" .. lang .. "' still not known by Mediawiki (could be a missing alias or variant)")
end
end
for i, lang in revipairs(ltrLangs) do
if ltrLangs[i - 1] == ltrLangs[i] then table.remove(ltrLangs, i) end
if isKnownLang[lang] == nil then
mw.log("LTR language '" .. lang .. "' still not known by Mediawiki (could be a missing alias or variant)")
end
end
-- Final presentation of current lists, sorted and deduplicated
mw.log("----")
mw.log("local rtlLangs = { '" .. table.concat(rtlLangs, "', '") .. "' }")
mw.log("local ltrLangs = { '" .. table.concat(ltrLangs, "', '") .. "' }")
return true
end }) --[==[ Enter this to run tests in the Lua console: =getmetatable(p).quickTests() --]==]
return p</text>
<sha1>n6dnippb8dl8nupbrxgqviac0hno50v</sha1>
</revision>
</page>
<page>
<title>Module:Dir/RTL overrides</title>
<ns>828</ns>
<id>95388411</id>
<revision>
<id>1223091335</id>
<timestamp>2020-07-03T04:07:06Z</timestamp>
<contributor>
<username>Amitie 10g</username>
<id>185006</id>
</contributor>
<comment>Created page with "local p = {} --[==[ Basic input sequences: relative order or duplicates does not matter here (but the end of the self test displays them sorted and deduplicated), but codes m..."</comment>
<origin>1223091335</origin>
<model>Scribunto</model>
<format>text/plain</format>
<text bytes="4566" sha1="cxld5o18iaxkhru8z4aje5lec04qed1" xml:space="preserve">local p = {}
--[==[ Basic input sequences: relative order or duplicates does not matter here (but the end of the self test displays them sorted and deduplicated), but codes must be valid and belong to only one of the two sequences).
Any missing language code will be checked with mw.language.new(code):isRTL(), which is costly in loaded resources (it can only check 20 languages at most including the content language) So it is best to map all languages that are the most likely to be used. --]==]
local rtlLangs = { 'aeb', 'aeb-arab', 'ar', 'arc', 'arq', 'ary', 'arz', 'azb', 'bcc', 'bgn', 'bqi', 'ckb', 'dv', 'fa', 'fa-af', 'glk', 'ha-arab', 'he', 'khw', 'kk-arab', 'kk-cn', 'ks-arab', 'ku-arab', 'lki', 'lrc', 'luz', 'mzn', 'nqo', 'ota', 'pnb', 'prd', 'ps', 'sd', 'sdh', 'skr', 'skr-arab', 'ug', 'ug-arab', 'ur', 'uz-arab', 'ydd', 'yi' }
local ltrLangs = { 'aa', 'ab', 'abs', 'ace', 'ady', 'ady-cyrl', 'aeb-latn', 'af', 'ak', 'aln', 'als', 'alt', 'am', 'ami', 'an', 'ang', 'anp', 'arn', 'as', 'ase', 'ast', 'atj', 'av', 'avk', 'awa', 'ay', 'az', 'ba', 'ban', 'bar', 'bat-smg', 'bbc', 'bbc-latn', 'bcl', 'be', 'be-tarask', 'be-x-old', 'bg', 'bh', 'bho', 'bi', 'bjn', 'bm', 'bn', 'bo', 'bpy', 'br', 'brh', 'bs', 'btm', 'bto', 'bu', 'bug', 'bxr', 'ca', 'cbk-zam', 'cdo', 'ce', 'ceb', 'ch', 'cho', 'chr', 'chy', 'co', 'cop', 'cps', 'cr', 'crh', 'crh-cyrl', 'crh-latn', 'cs', 'csb', 'cu', 'cv', 'cy', 'da', 'de', 'de-at', 'de-ch', 'de-formal', 'din', 'diq', 'dsb', 'dtp', 'dty', 'dz', 'ee', 'egl', 'el', 'eml', 'en', 'en-ca', 'en-gb', 'en-ie', 'en-us', 'eo', 'es', 'es-419', 'es-formal', 'et', 'eu', 'ext', 'ff', 'fi', 'fil', 'fit', 'fiu-vro', 'fj', 'fkv', 'fo', 'fr', 'frc', 'fro', 'frp', 'frr', 'fur', 'fy', 'ga', 'gag', 'gan', 'gan-hans', 'gan-hant', 'gcf', 'gcr', 'gd', 'gl', 'gn', 'gom', 'gom-deva', 'gom-latn', 'gor', 'got', 'grc', 'gsw', 'gu', 'gv', 'ha', 'hak', 'haw', 'hi', 'hif', 'hif-deva', 'hif-latn', 'hil', 'hmn', 'ho', 'hr', 'hrx', 'hsb', 'ht', 'hu', 'hu-formal', 'hy', 'hyw', 'hz', 'ia', 'id', 'ie', 'ig', 'ii', 'ik', 'ike-cans', 'ike-latn', 'ilo', 'inh', 'io', 'is', 'it', 'iu', 'ja', 'jam', 'jbo', 'jut', 'jv', 'ka', 'kaa', 'kab', 'kbd', 'kbd-cyrl', 'kbd-latn', 'kbp', 'kea', 'kg', 'ki', 'kiu', 'kj', 'kjp', 'kk', 'kk-cyrl', 'kk-kz', 'kk-latn', 'kk-tr', 'kl', 'km', 'kn', 'ko', 'ko-kp', 'ko-kr', 'koi', 'kr', 'krc', 'kri', 'krj', 'krl', 'ks', 'ks-deva', 'ksh', 'ku', 'ku-latn', 'kum', 'kv', 'kw', 'ky', 'la', 'lad', 'lb', 'lbe', 'lez', 'lfn', 'lg', 'li', 'lij', 'liv', 'lld', 'lmo', 'ln', 'lo', 'loz', 'lt', 'ltg', 'lus', 'lv', 'lzh', 'lzz', 'mai', 'map-bms', 'mdf', 'mg', 'mh', 'mhr', 'mi', 'min', 'mk', 'ml', 'mn', 'mni', 'mnw', 'mo', 'mr', 'mrj', 'ms', 'mt', 'mus', 'mwl', 'my', 'myv', 'na', 'nah', 'nan', 'nap', 'nb', 'nds', 'nds-nl', 'ne', 'new', 'ng', 'niu', 'nl', 'nl-informal', 'nn', 'no', 'nod', 'non', 'nov', 'nrf', 'nrf-fr', 'nrf-gg', 'nrf-je', 'nrm', 'nso', 'nv', 'ny', 'nys', 'oc', 'olo', 'om', 'or', 'os', 'pa', 'pag', 'pam', 'pap', 'pcd', 'pdc', 'pdt', 'pfl', 'pi', 'pih', 'pl', 'pms', 'pnt', 'prg', 'pt', 'pt-br', 'pt-cv', 'pt-pt', 'qu', 'quc', 'qug', 'rgn', 'rif', 'rm', 'rmf', 'rmy', 'rn', 'ro', 'roa-rup', 'roa-tara', 'ru', 'rue', 'rup', 'ruq', 'ruq-cyrl', 'ruq-latn', 'rw', 'rwr', 'sa', 'sah', 'sat', 'sc', 'scd', 'scn', 'sco', 'sdc', 'se', 'sei', 'ses', 'sg', 'sgs', 'sh', 'sh-cyrl', 'sh-latn', 'shi', 'shi-latn', 'shi-tfng', 'shn', 'shy-latn', 'si', 'simple', 'sjd', 'sje', 'sju', 'sk', 'sl', 'sli', 'sm', 'sma', 'smj', 'smn', 'sms', 'sn', 'so', 'sq', 'sr', 'sr-cyrl', 'sr-ec', 'sr-el', 'sr-latn', 'srn', 'srq', 'ss', 'st', 'stq', 'sty', 'su', 'sv', 'sw', 'szl', 'szy', 'ta', 'tay', 'tcy', 'te', 'tet', 'tg', 'tg-cyrl', 'tg-latn', 'th', 'ti', 'tk', 'tl', 'tly', 'tn', 'to', 'tokipona', 'tpi', 'tr', 'tru', 'trv', 'ts', 'tt', 'tt-cyrl', 'tt-latn', 'tum', 'tw', 'ty', 'tyv', 'tzl', 'tzm', 'udm', 'ug-latn', 'uk', 'uz', 'uz-cyrl', 'uz-latn', 've', 'vec', 'vep', 'vi', 'vls', 'vmf', 'vo', 'vot', 'vro', 'wa', 'war', 'wo', 'wuu', 'xal', 'xh', 'xmf', 'xsy', 'yo', 'yue', 'za', 'zea', 'zgh', 'zh', 'zh-classical', 'zh-cn', 'zh-hans', 'zh-hant', 'zh-hk', 'zh-min-nan', 'zh-mo', 'zh-my', 'zh-sg', 'zh-tw', 'zh-wuu', 'zh-yue', 'zu' }
-- Build the inverted map of languages to direction returned by this data module (fast, but collisions are not checked: run the test module) for _, lang in ipairs(rtlLangs) do p[lang] = true end for _, lang in ipairs(ltrLangs) do p[lang] = false end
-- Also store the two lists (at boolean indice), used by the test module to check the inverted map p[true] = rtlLangs p[false] = ltrLangs
return p</text>
<sha1>cxld5o18iaxkhru8z4aje5lec04qed1</sha1>
</revision>
</page>
<page>
<title>Template:SPARQLText</title>
<ns>10</ns>
<id>23033014</id>
<revision>
<id>1399250943</id>
<parentid>1399250772</parentid>
<timestamp>2021-04-10T14:44:00Z</timestamp>
<contributor>
<ip>87.126.92.234</ip>
</contributor>
<comment>Undid revision 1399250772 by 87.126.92.234 (talk)</comment>
<origin>1399250943</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="340" sha1="f35rnwtdn4sdogbp73jb3irfk0cvqp7" xml:space="preserve">{{#if:|
Template:IfTemplate:IfTemplate:IfTemplate:If }}...<noinclude>Template:Doc</noinclude></text>
<sha1>f35rnwtdn4sdogbp73jb3irfk0cvqp7</sha1>
</revision>
</page>
<page>
<title>Template:Int try it</title>
<ns>10</ns>
<id>109708780</id>
<redirect title="Template:Int run it" />
<revision>
<id>1764769125</id>
<timestamp>2022-11-04T21:44:15Z</timestamp>
<contributor>
<username>عُثمان</username>
<id>5050751</id>
</contributor>
<comment>عُثمان moved page Template:Int try it to Template:Int run it: the recent change to run it seems fine, but I was confused about where to find the template since the name did not match - move is inaccordance; redirects should resolve</comment>
<origin>1764769125</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="33" sha1="jwzw36nb8jui2zuk88ncwnse88o65qy" xml:space="preserve">#REDIRECT Template:Int run it</text>
<sha1>jwzw36nb8jui2zuk88ncwnse88o65qy</sha1>
</revision>
</page>
<page>
<title>Module:SPARQLMentions</title>
<ns>828</ns>
<id>28161729</id>
<revision>
<id>1453690994</id>
<parentid>661638891</parentid>
<timestamp>2021-07-04T13:54:47Z</timestamp>
<contributor>
<username>Azertus</username>
<id>1229135</id>
</contributor>
<comment>add getTitle</comment>
<origin>1453690994</origin>
<model>Scribunto</model>
<format>text/plain</format>
<text bytes="2760" sha1="lahzcbsmcekjpuk5o23yy8vvav8qfnz" xml:space="preserve">local p = {}
-- Return the label of a given data item, formatted for linking local function getLabel(frame, id, prefix) if prefix == nil then prefix = end if id == "defaultView:BubbleChart" then id = "Q24515280" end if id == "defaultView:Graph" then id = "Q24515287" end if id == "defaultView:Map" then id = "Q24515275" end
if id == "defaultView:ImageGrid" then id = "Q24515278" end
if id == "wikibase:box" then id = "Q26211169" end if id == "wikibase:cornerWest" then id = "Q26211177" end label = mw.wikibase.label( id ) if label == nil then linktext = id extra = else linktext = label .. " (" .. id .. ")" extra = ' ' .. frame:expandTemplate({ title="Reasonator", args= { [1] = id}}) .. ' ' .. frame:expandTemplate({ title="SQID", args= { [1] = id}}) end
link = mw.wikibase.getEntityUrl( id )
return '[' .. link .. ' ' .. linktext .. ']' .. extra; end
local function map(func, array)
local new_array = {}
for i,v in ipairs(array) do
new_array[i] = func(v)
end
return new_array
end
local function getAll(text, regexp, seen, items) if items == nil then items = {} end if seen == nil then seen = {} end for item in string.gmatch(text, regexp) do if seen[item] == nil then seen[item] = 1 table.insert(items, item) end end return items end
-- Produce list of items mentioned in the query
function p.getItems(frame)
if not mw.wikibase then
return "no mw.wikibase"
end
items = getAll(frame.args[1], 'wd:(Q%d+)') return table.concat(map(function(it) return getLabel(frame, it) end, items), ", ") end
-- Produce list of properties mentioned in the query function p.getProperties(frame) if not mw.wikibase then return "no mw.wikibase" end
seen = {} items = {} prefixes = {'wdt', 'p', 'ps', 'pr', 'pq', 'psv', 'pv', 'prv', 'pqv', 'wdtn', 'psn', 'pqn', 'prn', 'wdno' } for _, pr in ipairs(prefixes) do items = getAll(frame.args[1], pr .. ':(P%d+)', seen, items) end return table.concat(map(function(it) return getLabel(frame, it, 'Property:') end, items), ", ") end
function p.getFunctions(frame) if not mw.wikibase then return "no mw.wikibase" end
seen = {} items = {} func = {'defaultView:BubbleChart', 'defaultView:Graph', 'defaultView:Map', 'defaultView:ImageGrid', 'wikibase:box', "wikibase:cornerWest" } for _, pr in ipairs(func) do items = getAll(frame.args[1], pr, seen, items) end return table.concat(map(function(it) return getLabel(frame, it) end, items), ", ") end
function p.getTitle(frame) if not mw.wikibase then return "no mw.wikibase" end
for line in string.gmatch(frame.args[1], "[^%c]+%c?") do local title = string.match(line, '^#title:%s*([^%c]+)')
if not (title == nil) then return title end end end
return p</text>
<sha1>lahzcbsmcekjpuk5o23yy8vvav8qfnz</sha1>
</revision>
</page>
<page>
<title>Template:SQID</title>
<ns>10</ns>
<id>26259378</id>
<revision>
<id>1233859301</id>
<parentid>1227690908</parentid>
<timestamp>2020-07-18T14:13:28Z</timestamp>
<contributor>
<username>MisterSynergy</username>
<id>44949</id>
</contributor>
<comment>move URL to https://sqid.toolforge.org</comment>
<origin>1233859301</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="993" sha1="j6wq5aq6l7wsi92xtysclan6m8dprov" xml:space="preserve"><!--
-->{{#if: | Template:Q  }}<!-- -->{{#if: | Template:P  }}<!-- -->{{#if: | <span class="plainlinks">[https://sqid.toolforge.org/#{{#if:
| /view?id={{#if:
|
| {{#if:
| Q{{#titleparts:}}
| P{{#titleparts:}}
}}
}}&lang=⧼Lang⧽
| /?lang=⧼Lang⧽
}} ]</span>
}}<!-- --><nowiki/>?lang=⧼Lang⧽ }}<!-- --><noinclude>Template:Documentation</noinclude></text>
<sha1>j6wq5aq6l7wsi92xtysclan6m8dprov</sha1>
</revision>
</page>
<page>
<title>Template:Reasonator</title>
<ns>10</ns>
<id>17365939</id>
<revision>
<id>1556587517</id>
<parentid>1507464031</parentid>
<timestamp>2022-01-05T12:35:07Z</timestamp>
<contributor>
<username>Venca24</username>
<id>103280</id>
</contributor>
<comment>+ cs, eo</comment>
<origin>1556587517</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="882" sha1="ej9pd5v5fuipsemxo8gx8dbsqgg5vij" xml:space="preserve">{{#if:
| <span class="plainlinks">[6]</span> }} Template:TranslateThis<noinclude>Template:Documentation</noinclude></text>
<sha1>ej9pd5v5fuipsemxo8gx8dbsqgg5vij</sha1>
</revision>
</page>
<page>
<title>Template:WikiProject</title>
<ns>10</ns>
<id>21790485</id>
<revision>
<id>2298079997</id>
<parentid>2053606357</parentid>
<timestamp>2025-01-14T09:49:46Z</timestamp>
<contributor>
<username>Mormegil</username>
<id>28758</id>
</contributor>
<comment>+cs</comment>
<origin>2298079997</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="2446" sha1="afrxihplnkiijrydcgi7kwzg00a84sv" xml:space="preserve"><noinclude>Template:Doc</noinclude><!--
-->{{#ifexist: Wikidata:WikiProject <!--
#then:
-->|{{#if:<!--
#then:
-->|Template:Section link<!--
#else:
-->|Template:Ll<!--
-->}}<!--
#else:
-->|{{error<!--
-->|Template:TranslateThis<!--
-->}}<!--
--> <small>Template:TranslateThis<!--
--></small><!--
-->}}</text>
<sha1>afrxihplnkiijrydcgi7kwzg00a84sv</sha1>
</revision>
</page>
<page>
<title>Template:WikiProject/pagename</title>
<ns>10</ns>
<id>22491841</id>
<revision>
<id>1294585707</id>
<parentid>238479307</parentid>
<timestamp>2020-10-19T21:05:53Z</timestamp>
<contributor>
<username>Tacsipacsi</username>
<id>33956</id>
</contributor>
<comment>substitute template that doesn’t do what its name suggests and what it does in other projects</comment>
<origin>1294585707</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="60" sha1="8o2k69wu2sme8f490aakwi7ynj63jjv" xml:space="preserve">{{#if:|Wikidata Talk|Wikidata}}:WikiProject {{{1}}}</text>
<sha1>8o2k69wu2sme8f490aakwi7ynj63jjv</sha1>
</revision>
</page>
<page>
<title>Template:ItemOrNot</title>
<ns>10</ns>
<id>28161695</id>
<revision>
<id>361346548</id>
<parentid>361300782</parentid>
<timestamp>2016-08-02T21:22:10Z</timestamp>
<contributor>
<username>Smalyshev (WMF)</username>
<id>1482806</id>
</contributor>
<origin>361346548</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="384" sha1="230nkvb4w9pmw09vu3optxajqkjdr42" xml:space="preserve">{{#if: | * {{{1}}}: | }}<noinclude>
<templatedata> { "params": { "1": { "label": "List item name", "type": "string", "required": true }, "2": { "description": "List item contents", "type": "string" } }, "description": "Displays list item if second argument is not empty, otherwise nothing", "format": "block" } </templatedata> </noinclude></text>
<sha1>230nkvb4w9pmw09vu3optxajqkjdr42</sha1>
</revision>
</page>
<page>
<title>Template:Int Properties</title>
<ns>10</ns>
<id>25945270</id>
<revision>
<id>360948553</id>
<parentid>360948486</parentid>
<timestamp>2016-07-31T15:39:37Z</timestamp>
<contributor>
<username>Airon90</username>
<id>4782</id>
</contributor>
<origin>360948553</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="63" sha1="1f6bvc59pk8lngjngkff5ej07hrd17a" xml:space="preserve"><noinclude>Template:Doc</noinclude>Template:Capitalize</text>
<sha1>1f6bvc59pk8lngjngkff5ej07hrd17a</sha1>
</revision>
</page>
<page>
<title>Template:Int properties</title>
<ns>10</ns>
<id>25941214</id>
<revision>
<id>2504115378</id>
<parentid>2438818739</parentid>
<timestamp>2026-06-10T11:28:12Z</timestamp>
<contributor>
<username>مواطن تونسي</username>
<id>1537128</id>
</contributor>
<minor/>
<comment>traduction ar</comment>
<origin>2504115378</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="746" sha1="ao6colplfei84pspf07jmngpp7arssr" xml:space="preserve"><noinclude>Template:Doc</noinclude>Template:TranslateThis</text>
<sha1>ao6colplfei84pspf07jmngpp7arssr</sha1>
</revision>
</page>
<page>
<title>Template:SPARQL2/doc</title>
<ns>10</ns>
<id>35750675</id>
<revision>
<id>1425856775</id>
<parentid>1425856600</parentid>
<timestamp>2021-05-21T17:39:04Z</timestamp>
<contributor>
<username>PAC2</username>
<id>4892</id>
</contributor>
<comment>/* See also */ typo</comment>
<origin>1425856775</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="533" sha1="p2irk8qhdq7sqdc2n9kyjs3lvi2j5kw" xml:space="preserve"><nowiki>Template loop detected: Template:SPARQL2</nowiki>
Template loop detected: Template:SPARQL2
<nowiki>Template loop detected: Template:SPARQL2</nowiki>
Template loop detected: Template:SPARQL2
<nowiki>Template loop detected: Template:SPARQL2</nowiki>
Template loop detected: Template:SPARQL2
<nowiki>Template loop detected: Template:SPARQL2</nowiki>
Template loop detected: Template:SPARQL2
See also
<sha1>p2irk8qhdq7sqdc2n9kyjs3lvi2j5kw</sha1>
</revision>
</page>
<page>
<title>Template:Int run it</title>
<ns>10</ns>
<id>25022557</id>
<revision>
<id>2438820809</id>
<parentid>2033139854</parentid>
<timestamp>2025-12-06T14:46:20Z</timestamp>
<contributor>
<username>YeBoy371</username>
<id>2200680</id>
</contributor>
<origin>2438820809</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="1085" sha1="8ggotttekjqxrksv8jgpqj8yv3lzvla" xml:space="preserve"><noinclude>Template:Doc</noinclude>Template:TranslateThis</text>
<sha1>8ggotttekjqxrksv8jgpqj8yv3lzvla</sha1>
</revision>
</page>
</mediawiki></nowiki>
<mediawiki xmlns="http://www.mediawiki.org/xml/export-0.11/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.11/ http://www.mediawiki.org/xml/export-0.11.xsd" version="0.11" xml:lang="en">
<siteinfo> <sitename>Wikidata</sitename> <dbname>wikidatawiki</dbname> <base>https://www.wikidata.org/wiki/Wikidata:Main_Page</base> <generator>MediaWiki 1.47.0-wmf.17</generator> <case>first-letter</case> <namespaces> <namespace key="-2" case="first-letter">Media</namespace> <namespace key="-1" case="first-letter">Special</namespace> <namespace key="0" case="first-letter" /> <namespace key="1" case="first-letter">Talk</namespace> <namespace key="2" case="first-letter">User</namespace> <namespace key="3" case="first-letter">User talk</namespace> <namespace key="4" case="first-letter">Wikidata</namespace> <namespace key="5" case="first-letter">Wikidata talk</namespace> <namespace key="6" case="first-letter">File</namespace> <namespace key="7" case="first-letter">File talk</namespace> <namespace key="8" case="first-letter">MediaWiki</namespace> <namespace key="9" case="first-letter">MediaWiki talk</namespace> <namespace key="10" case="first-letter">Template</namespace> <namespace key="11" case="first-letter">Template talk</namespace> <namespace key="12" case="first-letter">Help</namespace> <namespace key="13" case="first-letter">Help talk</namespace> <namespace key="14" case="first-letter">Category</namespace> <namespace key="15" case="first-letter">Category talk</namespace> <namespace key="120" case="first-letter">Property</namespace> <namespace key="121" case="first-letter">Property talk</namespace> <namespace key="122" case="first-letter">Query</namespace> <namespace key="123" case="first-letter">Query talk</namespace> <namespace key="146" case="first-letter">Lexeme</namespace> <namespace key="147" case="first-letter">Lexeme talk</namespace> <namespace key="640" case="first-letter">EntitySchema</namespace> <namespace key="641" case="first-letter">EntitySchema talk</namespace> <namespace key="710" case="first-letter">TimedText</namespace> <namespace key="711" case="first-letter">TimedText talk</namespace> <namespace key="828" case="first-letter">Module</namespace> <namespace key="829" case="first-letter">Module talk</namespace> <namespace key="1198" case="first-letter">Translations</namespace> <namespace key="1199" case="first-letter">Translations talk</namespace> <namespace key="1728" case="first-letter">Event</namespace> <namespace key="1729" case="first-letter">Event talk</namespace> <namespace key="2600" case="first-letter">Topic</namespace> </namespaces> </siteinfo> <page> <title>Template:SPARQL2</title> <ns>10</ns> <id>28161690</id> <revision> <id>2346047691</id> <parentid>2346040648</parentid> <timestamp>2025-05-08T12:02:25Z</timestamp> <contributor> <username>Madamebiblio</username> <id>2952832</id> </contributor> <minor/> <comment>Reverted edits by 201.143.205.181 (talk) to last revision by Kokage si</comment> <origin>2294596805</origin> <model>wikitext</model> <format>text/x-wiki</format> <text bytes="7567" sha1="s4975lvx7s2i4pjji1govtxccu2rt3e" xml:space="preserve">Template:SPARQL2/doc
<onlyinclude>Template:Clear{{#ifeq:test|test| <!--hidden hints--> | {{TranslateThis<!--
-->|ar=يستخدم الاستعلام التالي هذه:<!--
-->|be-tarask=Дадзены запыт выкарыстоўвае:<!--
-->|cs=Následující dotaz používá:<!--
-->|de=Die Suchanfrage verwendet:<!--
-->|en=The following query uses these:<!--
-->|en-gb=The following query uses these:<!--
-->|el=Το ακόλουθο ερώτημα χρησιμοποιεί αυτά:<!--
-->|es=La siguiente consulta utiliza lo siguiente:<!--
-->|fi=Seuraava kysely käyttää näitä:<!--
-->|fr=La requête suivante utilise ces :<!--
-->|hu=Ez a lekérdezés a következőket használja:<!--
-->|id=Kueri di bawah akan menggunakan entitas berikut:<!--
-->|it=La seguente query utilizza questi:<!--
-->|ja=以下のクエリではこれらを使用します:<!--
-->|nl=Deze query gebruikt:<!--
-->|pl=To zapytanie używa:<!--
-->|pt=A consulta seguinte utiliza estes:<!--
-->|pt-br=A consulta seguinte utiliza estes:<!--
-->|ru=Этот запрос использует:<!--
-->|sv=Följande fråga använder dessa:<!--
-->|tr=Aşağıdaki sorgu bunları kullanıyor:<!--
-->|uk=Цей запит використовує:<!--
-->}}<!-- -->Template:ItemOrNot <!-- -->Template:ItemOrNot <!-- -->Template:ItemOrNot <!--
-->}}
[[:Template:SPARQLText]]
<!-- --><div class="displayonly">{{#if: ||Template:Int try it}}</div>Template:Clear</onlyinclude><noinclude> <templatedata> { "params": { "query": { "required": true, "label": { "ar": "استعلام", "be-tarask": "запыт", "cs": "dotaz", "en": "query", "es": "consulta", "fr": "requête", "id": "kueri", "it": "query", "ja": "クエリ", "pl": "zapytanie", "pt": "consulta", "pt-br": "consulta", "sv": "fråga",
"tr": "sorgu",
"uk": "запит" }, "description": { "ar": "استعلام سباركل", "be-tarask": "запыт SPARQL", "cs": "SPARQL dotaz", "en": "SPARQL query", "es": "consulta SPARQL", "fr": "la requête que le modèle doit traiter et afficher", "id": "kueri SPARQL", "it": "query SPARQL", "ja": "SPARQLクエリ", "pl": "query SPARQL", "pt": "consulta SPARQL", "pt-br": "consulta SPARQL", "sv": "SPARQL fråga", "tr": "SPARQL sorgusu", "uk": "запит SPARQL" }, "example": { "be-tarask": "SELECT * WHERE { ?x wdt:P31 wd:Q5 } LIMIT 1", "cs": "SELECT * WHERE { ?x wdt:P31 wd:Q5 } LIMIT 1", "en": "SELECT * WHERE { ?x wdt:P31 wd:Q5 } LIMIT 1", "es": "SELECT ?item WHERE { ?item wdt:P31 wd:Q5 } LIMIT 1", "fr": "select ?item where { ?item wdt:P31 wd:Q5 } LIMIT 1", "id": "SELECT * WHERE { ?a wdt:P31 wd:Q5 } LIMIT 1", "it": "select ?item where { ?item wdt:P31 wd:Q5 } LIMIT 1", "pt": "select ?item where { ?item wdt:P31 wd:Q5 } LIMIT 1", "pt-br": "select ?item where { ?item wdt:P31 wd:Q5 } LIMIT 1" }, "type": "string", "aliases": [ "sparql" ], "suggested": true }, "extraprefix": { "description": { "ar": "بادئات إضافية لإضافتها",
"be-tarask": "дадатковыя прэфіксы (неабавязковыя)",
"cs": "Dodatečné prefixy (volitelné)", "en": "Extra prefixes to be added", "es": "Prefijos extra a añadir (opcional)", "fr": "les préfixes SPARQL non standards ou inconnus du service de requête éventuellement nécessaires (optionnel)", "id": "Prefiks SPARQL yang akan ditambahkan", "it": "Aggiungere i prefissi SPARQL non standard o sconosciuti eventualmente necessari (opzionale)", "ja": "追加する接頭辞(オプション)", "pl": "Dodatkowe prefiksy (opcjonalnie)", "pt": "Adicionar os prefixos SPARQL não padrões ou desconhecidos eventualmente necessários (opcional)", "pt-br": "Adicionar os prefixos SPARQL não padrões ou desconhecidos eventualmente necessários (opcional)", "uk": "Додаткові префікси (необов'язкові)" }, "example": "PREFIX wikibase: <http://wikiba.se/ontology#>", "type": "string" } }, "description": {
"be-tarask": "Гэты шаблён выводзіць запыт SPARQL з падсьветкай сынтаксісу, выкарыстаных элемэнтаў і спасылак на WDQS дзеля запуску запыту. \nЗРАБІЦЬ: скарыстаныя меткі элемэнтаў не лякалізаваныя",
"cs": "Tato šablona zobrazuje SPARQL dotaz ze zvýrazněnou syntaxí, použité položky a odkaz na WDQS dotazovací službu pro vyzkoušení.", "en": "This template displays SPARQL query with syntax highlighting, used items and link to WDQS query site to run the query. \nTODO: used items labels are not localized", "es": "Esta plantilla muestra una consulta SPARQL con resaltado de sintaxis, los items utilizados y un enlace al WDQS para lanzar la consulta", "fr": "Ce modèle affiche une requête SPARQL et permet de la lancer au travers du service de requête Wikidata. Il affiche aussi quelques informations basiques sur les éléments et fonctionnalités utilisées par cette requête", "id": "Templat ini menampilkan kueri SPARQL dengan pembedaan warna pada sintaks beserta entitas Wikidata yang digunakan dan pranala kueri di WDQS.", "it": "Questo template mostra una query SPARQL evidenziandone la sintassi e gli elementi usati e fornisce un link alla query WDQS site che permette di lanciare la query", "ja": "このテンプレートは構文強調付きのSPARQLクエリ、使用した項目、クエリを実行するWDQSクエリサイトへのリンクを表示します。", "pl": "Szablon wyświetla zapytanie SPARQL z podświetlaniem składni, listą użytych elementów i linkiem do WDQS.", "pt": "Esta predefinição mostra uma consulta SPARQL na qual evidencia a sintaxe e os elementos usados e fornece um enlace ao site WDQS que permite executar a consulta", "pt-br": "Esta predefinição mostra uma consulta SPARQL na qual evidencia a sintaxe e os elementos usados e fornece um enlace ao site WDQS que permite executar a consulta", "sv": "Denna mall visar en SPARQL fråga med syntaxfärgning, använda objekt och länk till WDQS frågesajten för att köra frågan. \nTODO: använda objekts etiketter är inte lokaliserade", "uk": "Цей шаблон показує запит SPARQL з підсвічуванням елементів синтаксису, список використаних елементів і посилання на сайт WDQS-запиту." }, "paramOrder": [ "query", "extraprefix" ], "format": "block" } </templatedata> </noinclude></text>
<sha1>s4975lvx7s2i4pjji1govtxccu2rt3e</sha1>
</revision>
</page>
<page>
<title>Template:Template</title>
<ns>10</ns>
<id>12414</id>
<redirect title="Template:Tl" />
<revision>
<id>431881</id>
<parentid>312894</parentid>
<timestamp>2012-11-13T02:07:50Z</timestamp>
<contributor>
<username>~riley</username>
<id>2219</id>
</contributor>
<comment>http://en.wikipedia.org/w/index.php?title=Template:Template&action=edit</comment>
<origin>431881</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="25" sha1="cdpzj9yp99pn5v093b404f4sc7cybv1" xml:space="preserve">#REDIRECT Template:Tl</text>
<sha1>cdpzj9yp99pn5v093b404f4sc7cybv1</sha1>
</revision>
</page>
<page>
<title>Template:Tl</title>
<ns>10</ns>
<id>3170</id>
<revision>
<id>2508986920</id>
<parentid>1946850712</parentid>
<timestamp>2026-06-22T01:25:21Z</timestamp>
<contributor>
<username>RogueScholar</username>
<id>3003918</id>
</contributor>
<minor/>
<comment>Format template code for readability and convert numeric HTML entities to named equivalents to accomplish the same</comment>
<origin>2508986920</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="1299" sha1="dqel96mgakegupz568kpnt91rdib9m4" xml:space="preserve"><includeonly><code>{{{{#if:|subst:}}<!-- Begin evaluation of first parameter.
-->{{#ifeq:{|:|:[[]]|<!-- If already prefixed by colon, show the link as such, too.
-->{{#switch:<!-- Target's namespace determines the link format. -->
| | Template = [[Template:|]]<!-- Main: (absent) or Template: namespaces -->
| File | Category = [[:{{{1}}}]]<!-- File and Category namespaces receive hidden colon prefix. -->
| #default = [[{{{1}}}]]<!-- All others are linked verbatim.
-->}}<!-- End of switch function. -->}}<!-- End of first parameter evaluation.
-->{{#ifeq: {{{2}}}| x||{{{2}}}}}<!--
-->{{#ifeq: {{{3}}}| x||{{{3}}}}}<!--
-->{{#ifeq: {{{4}}}| x||{{{4}}}}}<!--
-->{{#ifeq: {{{5}}}| x||{{{5}}}}}<!--
-->{{#ifeq: {{{6}}}| x||{{{6}}}}}<!--
-->{{#ifeq: {{{7}}}| x||{{{7}}}}}<!--
-->{{#ifeq: {{{8}}}| x||{{{8}}}}}<!--
-->{{#ifeq: {{{9}}}| x||{{{9}}}}}<!--
-->{{#ifeq:{{{10}}}|x||{{{10}}}}}}}</code></includeonly><noinclude>
Template:Documentation</noinclude></text>
<sha1>dqel96mgakegupz568kpnt91rdib9m4</sha1>
</revision>
</page>
<page>
<title>Template:Capitalize</title>
<ns>10</ns>
<id>24835143</id>
<revision>
<id>2283223741</id>
<parentid>2282968755</parentid>
<timestamp>2024-12-03T22:55:49Z</timestamp>
<contributor>
<username>Tacsipacsi</username>
<id>33956</id>
</contributor>
<comment>Undid revision 2282968755 by 2806:2F0:A080:F124:78E9:9300:6983:EA83 (talk): ???</comment>
<origin>2283223741</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="100" sha1="08bgnnmlolmwjwag381zkq615fl2s0a" xml:space="preserve"><includeonly>Script error: No such module "Capitalize".</includeonly><noinclude>
Template:Doc </noinclude></text>
<sha1>08bgnnmlolmwjwag381zkq615fl2s0a</sha1>
</revision>
</page>
<page>
<title>Template:Int items</title>
<ns>10</ns>
<id>28641837</id>
<revision>
<id>2438810545</id>
<parentid>2208740771</parentid>
<timestamp>2025-12-06T14:15:50Z</timestamp>
<contributor>
<username>YeBoy371</username>
<id>2200680</id>
</contributor>
<origin>2438810545</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="475" sha1="knyh87z85w0os01yxpmvrzvlnwf07fb" xml:space="preserve"><noinclude>Template:Doc</noinclude>Template:TranslateThis</text>
<sha1>knyh87z85w0os01yxpmvrzvlnwf07fb</sha1>
</revision>
</page>
<page>
<title>Module:Capitalize</title>
<ns>828</ns>
<id>25940912</id>
<revision>
<id>333880118</id>
<parentid>327538585</parentid>
<timestamp>2016-05-08T21:08:10Z</timestamp>
<contributor>
<username>TomT0m</username>
<id>7333</id>
</contributor>
<comment>cap after the tags</comment>
<origin>333880118</origin>
<model>Scribunto</model>
<format>text/plain</format>
<text bytes="518" sha1="oi3oo9q42s5okxrm5hbfy01zk32pehp" xml:space="preserve">
local p = {}
function p.cap(str) lang = mw.getContentLanguage() if lang:ucfirst(str) ~= str then return lang:ucfirst(str) else local substr = mw.ustring.sub b, e = mw.ustring.find(str, ">%s*%a") while e ~= nil do if mw.ustring.find(">", substr(str, b,e)) == nil then return substr(str, 1, e-1) .. lang:ucfirst(substr(str,e,e)) ..substr(str, e+1) end b, e = mw.ustring.find(str, ">%s*%a", e) end return str end end
function p.capitalize(frame) return p.cap(frame.args[1]) end
return p</text>
<sha1>oi3oo9q42s5okxrm5hbfy01zk32pehp</sha1>
</revision>
</page>
<page>
<title>Template:Clear</title>
<ns>10</ns>
<id>12131100</id>
<revision>
<id>665474881</id>
<parentid>91992232</parentid>
<timestamp>2018-04-14T18:59:12Z</timestamp>
<contributor>
<username>Dataeast0000001</username>
<id>2952466</id>
</contributor>
<comment>move onlyinclude to noinclude</comment>
<origin>665474881</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="79" sha1="5aa2j06l3n3husy1g6jggf6oznzocau" xml:space="preserve"><div style="clear:both;"></div><noinclude>Template:Documentation</noinclude></text>
<sha1>5aa2j06l3n3husy1g6jggf6oznzocau</sha1>
</revision>
</page>
<page>
<title>Module:Fallback</title>
<ns>828</ns>
<id>19181086</id>
<revision>
<id>714642825</id>
<parentid>714642495</parentid>
<timestamp>2018-07-23T16:35:03Z</timestamp>
<contributor>
<username>Matěj Suchánek</username>
<id>53613</id>
</contributor>
<minor/>
<comment>fix</comment>
<origin>714642825</origin>
<model>Scribunto</model>
<format>text/plain</format>
<text bytes="5559" sha1="6vr2in87podxnsj3x2jttt1r1qisf9q" xml:space="preserve">local p = {}
function p.fblist(lang, langonly) -- list the full fallback chain from a language to en local fbtable = mw.language.getFallbacksFor(lang) table.insert(fbtable, 1, lang) if not langonly then table.insert(fbtable, 'message') table.insert(fbtable, 'item') table.insert(fbtable, 'default') end return fbtable end
function p._langSwitch(args, lang) -- args: table of translations -- Return error if there is not default and no English version -- otherwise returns the message in the most appropriate, plus the lang code as a second value if not args.en and not args.default and not args.message and not args.item and args.nocat ~= '1' then return error("langSwitch error: no default") end -- get language (either stated one or user's default language) if not lang then return '<strong class="error">LangSwitch Error: no lang</strong>' -- must become proper error end -- get the list of acceptable language (lang + those in lang's fallback chain) and check their content for i, j in ipairs(p.fblist(lang)) do if args[j] then if args[j] == '~' then return nil, j end if j == 'item' then local label, lang = mw.wikibase.getLabelWithLang(args[j]) if label then return label, lang else return args[j], 'en' end end if j == 'message' then return tostring(mw.message.new(args[j]):inLanguage(lang)) end -- if this is an interface message if args[j] ~= then return args[j], j end end end return nil end
function p.langSwitch(frame) -- version to be used from wikitext local args = frame.args -- if no expected args provided than check parent template/module args if not args.en and not args.default and not args.nocat then args = frame:getParent().args end local lang if args.lang and args.lang ~= then lang = args.lang args.lang = nil else -- get user's chosen language lang = frame:preprocess( "⧼lang⧽" ) end local str, language = p._langSwitch(args, lang) return str -- get the first value of the langSwitch, (the text) not the second (the language) end
function p.fallbackpage(base, lang, formatting) local languages = p.fblist(lang) for i, lng in ipairs(languages) do if mw.title.new(base .. '/' .. lng).exists then if formatting == 'table' then return {base .. '/' .. lng, lng} -- returns name of the page + name of the language else return base .. '/' .. lng -- returns only the page end end end return base end
function p.autotranslate(frame) -- logic for template:Autotranslate local args = frame.args if not args.lang or args.lang == then args.lang = frame:preprocess( "⧼lang⧽" ) -- get user's chosen language end
-- find base page local base = args.base if not base or base == then return '<strong class="error">Base page not provided for autotranslate</strong>' end if string.sub(base, 2, 9) ~= 'emplate:' then base = 'Template:' .. base -- base provided without 'Template:' part end
-- find base template language subpage local page = p.fallbackpage(base, args.lang) -- if (not page and base ~= args.base) then -- try the original args.base string. This case is only needed if base is not in template namespace page = p.fallbackpage(args.base, args.lang) end if not page then return string.format('<strong class="error">no fallback page found for autotranslate (base=%s, lang=%s)</strong>', args.base, args.lang) end
-- repack args in a standard table local newargs = {} for field, value in pairs(args) do if field ~= 'base' then newargs[field] = value end end
-- Transclude Template:Page with template arguments the same as the ones passed to Template:Autotranslate template. return frame:expandTemplate{ title = page, args = newargs } end
function p.translate(page, key, lang) --translate data stored in a module if type(page) == 'string' then -- if the requested translation table is not yet loaded page = require('Module:' .. page) end
local val if page[key] then val = page[key] elseif page.keys and page.keys[key] then-- key 'keys" is an index of all keys, including redirects, see Module:i18n/datatype val = page.keys[key] end if not val then return '<' .. key .. '>' end return p._langSwitch(val, lang) end
function p.translatelua(frame) local lang = frame.args.lang local page = require('Module:' .. mw.text.trim(frame.args[1])) -- page should only contain a simple of translations if not lang or mw.text.trim(lang) == then lang = frame:preprocess( "⧼lang⧽" ) end if frame.args[2] then page = page[mw.text.trim(frame.args[2])] end return p._langSwitch(page, lang) end
function p.runTests() local toFallbackTest = require('Module:Fallback/tests/fallbacks') local result = true
mw.log('Testing fallback chains') for i, t in ipairs(toFallbackTest) do local fbtbl = table.concat(p.fblist(t.initial), ', ') local expected = table.concat(t.expected, ', ') local ret = (fbtbl == expected) mw.log(i, ret and 'passed' or 'FAILED', t.initial, (not ret) and ('FAILED\nis >>' .. fbtbl .. '<<\nbut should be >>' .. expected .. '<<\n') or ) result = result and ret end
return result end
function p.showTemplateArguments(frame) -- list all input arguments of the template that calls "Script error: No such module "Fallback"." local str = for name, value in pairs( frame:getParent().args ) do if str == then str = string.format('%s=%s', name, value) -- argument #1 else str = string.format('%s, %s=%s', str, name, value) -- the rest end end return str end
return p</text>
<sha1>6vr2in87podxnsj3x2jttt1r1qisf9q</sha1>
</revision>
</page>
<page>
<title>Template:Ll</title>
<ns>10</ns>
<id>3264473</id>
<revision>
<id>618665821</id>
<parentid>443393354</parentid>
<timestamp>2018-01-11T02:59:59Z</timestamp>
<contributor>
<username>Jarekt</username>
<id>1274</id>
</contributor>
<comment>Fulfilling edit request by User:Kaganer. Thanks for helping!</comment>
<origin>618665821</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="178" sha1="h8s4unutwk14jcbyfcq88r5yvqbu5x5" xml:space="preserve">[[Special:MyLanguage/{{{1}}}{{#if:|#{{{anchor}}}}}|Template:PDT</includeonly>]]<noinclude>
Template:Documentation </noinclude></text>
<sha1>h8s4unutwk14jcbyfcq88r5yvqbu5x5</sha1>
</revision>
</page>
<page>
<title>Template:TranslateThis</title>
<ns>10</ns>
<id>16552759</id>
<revision>
<id>483148362</id>
<parentid>483129342</parentid>
<timestamp>2017-05-08T01:54:31Z</timestamp>
<contributor>
<username>MKar</username>
<id>6110</id>
</contributor>
<minor/>
<comment>Undid revision 483129342 by 70.71.90.6 (talk)</comment>
<origin>483148362</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="97" sha1="rm4lztokzfib496c8sbt9q36vx6n9tz" xml:space="preserve"><includeonly>Script error: No such module "TranslateThis".</includeonly><noinclude>Template:Documentation</noinclude></text>
<sha1>rm4lztokzfib496c8sbt9q36vx6n9tz</sha1>
</revision>
</page>
<page>
<title>Module:TranslateThis</title>
<ns>828</ns>
<id>16552706</id>
<revision>
<id>2144500220</id>
<parentid>1980692436</parentid>
<timestamp>2024-05-04T13:29:50Z</timestamp>
<contributor>
<username>Uzume</username>
<id>11596</id>
</contributor>
<comment>switch frame:preprocess("⧼lang⧽") to callParserFunction("int", "lang")</comment>
<origin>2144500220</origin>
<model>Scribunto</model>
<format>text/plain</format>
<text bytes="1738" sha1="j2it1vjxk477pw54t7yheap3g9xt452" xml:space="preserve">local fb = require('Module:Fallback')
local dir = require('Module:Dir')
return { main = function( frame )
local function shallowcopy(orig) if type(orig) ~= 'table' then return orig end
local result = {} for key, value in pairs(orig) do result[key] = value end return result end
local args = shallowcopy(frame:getParent().args) local lang = args.lang or frame:callParserFunction("int", "lang") -- I don't know of any other way to get the user's language... args.lang = nil
local anchor = args.anchor args.anchor = nil if (anchor and args[anchor]) then anchor = args[anchor] end anchor = anchor and frame:expandTemplate( { title = "Anchor", args = { anchor } } ) or
local result = args[ lang ] if result and result ~= then result = '<span dir="' .. dir.select(lang, 'rtl', 'ltr') .. '" lang="' .. lang .. '">' .. result .. '</span>' else local default = {} for i, v in pairs( args ) do if v ~= "" then table.insert(default, '<span dir="' .. dir.select(i, 'rtl', 'ltr') .. '" lang="' .. i .. '">' .. v .. '</span> <small>(' .. i .. ')</small>') end end default = table.concat(default, ' / ') args.default=default local newlang result, newlang = fb._langSwitch(args, lang) if not newlang then result = elseif newlang~='default' then result = '<span dir="' .. dir.select(newlang, 'rtl', 'ltr') .. '" lang="' .. newlang .. '">' .. result .. '</span> <small>(' .. newlang .. ')</small>' end local langname = mw.language.fetchLanguageName( lang, lang ) if langname ~= "" and newlang then result = result .. " – " .. frame:expandTemplate( { title = "Help translate", args = { langname, lang = lang } } ) end end
return anchor .. result end}</text>
<sha1>j2it1vjxk477pw54t7yheap3g9xt452</sha1>
</revision>
</page>
<page>
<title>Module:Dir</title>
<ns>828</ns>
<id>95388294</id>
<revision>
<id>1935187194</id>
<parentid>1935159027</parentid>
<timestamp>2023-07-15T22:41:28Z</timestamp>
<contributor>
<username>Tacsipacsi</username>
<id>33956</id>
</contributor>
<comment>Undid revision 1935159027 by 177.232.91.83 (talk): test edit</comment>
<origin>1935187194</origin>
<model>Scribunto</model>
<format>text/plain</format>
<text bytes="5612" sha1="n6dnippb8dl8nupbrxgqviac0hno50v" xml:space="preserve">-- This module implements Template:Dir.
-- local rtlOverrides = mw.loadData('Module:Dir/RTL overrides') -- !!! mw.loadData() is currently broken, it does NOT load anything local rtlOverrides = require('Module:Dir/RTL overrides') local p = {}
local function trim(s)
if s and s ~= then s = tostring(s):match('^%s*(.-)%s*$') end
if s == then return nil end
return s
end
function p.rtlLangs(isRTL)
if isRTL == nil then isRTL = true end
return rtlOverrides[isRTL] or {}
end
function p.isRTL(code)
if type(code) ~= 'string' then return nil end
local v = rtlOverrides[code] -- very fast and not limited in the number of supported languages
if v ~= nil then return v end -- return it if mapped, otherwise use MediaWiki library:
local success, ret = pcall(function ()
return mw.language.new(code):isRTL() -- expensive and limited to 20 languages per MediaWiki instance
end)
return success and ret
end
function p.select(code, rtl, ltr)
if p.isRTL(code) then
return rtl
else
return ltr
end
end
-- Used via a template Template:Dir -- which just calls Script error: No such module "Dir"., the 3 parameters are automatically trimmed: -- Parameter 1 takes the default value from ⧼Lang⧽ if it's empty or not specified. -- Parameter 2 can be named rtl, may be explicitly empty, otherwise takes the default value 'rtl' only if it's not specified. -- Parameter 3 can be named ltr, may be explicitly empty, otherwise takes the default value 'ltr' only if it's not specified. function p.main(frame)
local args = frame:getParent().args -- Parameters used to transclude Template:Dir
local code = trim(args[1]) or frame:callParserFunction('Int', 'Lang')
local rtl = trim(args.rtl or args[2] or 'rtl')
local ltr = trim(args.ltr or args[3] or 'ltr')
return p.select(code, rtl, ltr)
end
setmetatable(p, { quickTests = function ()
local rtlLangs = p.rtlLangs(true) local ltrLangs = p.rtlLangs(false)
-- Basic check of data format
local function checkLangs(name, langs)
for k, lang in pairs(langs) do
assert(type(k) == 'number' and k == math.floor(k)
and type(lang) == 'string' and #lang >= 2 and #lang <= 16
and lang:find('^[a-z][%-0-9a-z]*[0-9a-z]$') == 1,
": Invalid sequence of language codes, " .. name .. "['" .. k .. "'] = '" .. lang .. "'")
end
return true
end
local ok, msg
ok, msg = pcall(checkLangs, 'rtlLangs', rtlLangs)
if not ok then return false, msg end
ok, msg = pcall(checkLangs, 'ltrLangs', ltrLangs)
if not ok then return false, msg end
-- Build inverse maps of languages having each direction
local isrtl, isltr = {}, {}
for _, lang in ipairs(rtlLangs) do isrtl[lang] = true end
for _, lang in ipairs(ltrLangs) do isltr[lang] = true end
-- Check conflicts using the two inverse maps
for _, lang in ipairs(rtlLangs) do
if isltr[lang] then return false, ": Direction conflict for '" .. lang .. "'" end
end
for _, lang in ipairs(ltrLangs) do
if isrtl[lang] then return false, ": Direction conflict for '" .. lang .. "'" end
end
-- Log missing languages (allows filling the tables above) according to MediaWiki internal data
local knownLangs, isKnownLang = mw.language.fetchLanguageNames(), {}
for lang, _ in pairs(knownLangs) do
isKnownLang[lang] = true
if rtlOverrides[lang] == nil then -- only if we still don't have data for this language
-- Note: we cannot check more than 20 languages at once, then MediaWiki raises an error.
-- So this test only runs on the Lua console, where you can update the tables at top.
-- This also means we cannot compare what MediaWiki returns with the direction we map here for all languages.
ok, value = pcall(function() return tostring(mw.language.new(lang):isRTL()) end)
mw.log("Warning: missing direction for language '" .. lang .. "', MediaWiki returns '" .. value .. "'")
end
end
-- utility: reverse order iterator on sequences
local function revipairs(t)
return function(t, i)
i = i - 1
local v = t[i]
if v == nil then return nil end
return i, v
end, t, #t + 1
end
-- Sort and deduplicate language code values (by scanning backward) for data cleanup
-- Also log languages having a direction mapping in this module but still not known by MediaWiki
table.sort(rtlLangs)
table.sort(ltrLangs)
for i, lang in revipairs(rtlLangs) do
if rtlLangs[i - 1] == rtlLangs[i] then table.remove(rtlLangs, i) end
if isKnownLang[lang] == nil then
mw.log("RTL language '" .. lang .. "' still not known by Mediawiki (could be a missing alias or variant)")
end
end
for i, lang in revipairs(ltrLangs) do
if ltrLangs[i - 1] == ltrLangs[i] then table.remove(ltrLangs, i) end
if isKnownLang[lang] == nil then
mw.log("LTR language '" .. lang .. "' still not known by Mediawiki (could be a missing alias or variant)")
end
end
-- Final presentation of current lists, sorted and deduplicated
mw.log("----")
mw.log("local rtlLangs = { '" .. table.concat(rtlLangs, "', '") .. "' }")
mw.log("local ltrLangs = { '" .. table.concat(ltrLangs, "', '") .. "' }")
return true
end }) --[==[ Enter this to run tests in the Lua console: =getmetatable(p).quickTests() --]==]
return p</text>
<sha1>n6dnippb8dl8nupbrxgqviac0hno50v</sha1>
</revision>
</page>
<page>
<title>Module:Dir/RTL overrides</title>
<ns>828</ns>
<id>95388411</id>
<revision>
<id>1223091335</id>
<timestamp>2020-07-03T04:07:06Z</timestamp>
<contributor>
<username>Amitie 10g</username>
<id>185006</id>
</contributor>
<comment>Created page with "local p = {} --[==[ Basic input sequences: relative order or duplicates does not matter here (but the end of the self test displays them sorted and deduplicated), but codes m..."</comment>
<origin>1223091335</origin>
<model>Scribunto</model>
<format>text/plain</format>
<text bytes="4566" sha1="cxld5o18iaxkhru8z4aje5lec04qed1" xml:space="preserve">local p = {}
--[==[ Basic input sequences: relative order or duplicates does not matter here (but the end of the self test displays them sorted and deduplicated), but codes must be valid and belong to only one of the two sequences).
Any missing language code will be checked with mw.language.new(code):isRTL(), which is costly in loaded resources (it can only check 20 languages at most including the content language) So it is best to map all languages that are the most likely to be used. --]==]
local rtlLangs = { 'aeb', 'aeb-arab', 'ar', 'arc', 'arq', 'ary', 'arz', 'azb', 'bcc', 'bgn', 'bqi', 'ckb', 'dv', 'fa', 'fa-af', 'glk', 'ha-arab', 'he', 'khw', 'kk-arab', 'kk-cn', 'ks-arab', 'ku-arab', 'lki', 'lrc', 'luz', 'mzn', 'nqo', 'ota', 'pnb', 'prd', 'ps', 'sd', 'sdh', 'skr', 'skr-arab', 'ug', 'ug-arab', 'ur', 'uz-arab', 'ydd', 'yi' }
local ltrLangs = { 'aa', 'ab', 'abs', 'ace', 'ady', 'ady-cyrl', 'aeb-latn', 'af', 'ak', 'aln', 'als', 'alt', 'am', 'ami', 'an', 'ang', 'anp', 'arn', 'as', 'ase', 'ast', 'atj', 'av', 'avk', 'awa', 'ay', 'az', 'ba', 'ban', 'bar', 'bat-smg', 'bbc', 'bbc-latn', 'bcl', 'be', 'be-tarask', 'be-x-old', 'bg', 'bh', 'bho', 'bi', 'bjn', 'bm', 'bn', 'bo', 'bpy', 'br', 'brh', 'bs', 'btm', 'bto', 'bu', 'bug', 'bxr', 'ca', 'cbk-zam', 'cdo', 'ce', 'ceb', 'ch', 'cho', 'chr', 'chy', 'co', 'cop', 'cps', 'cr', 'crh', 'crh-cyrl', 'crh-latn', 'cs', 'csb', 'cu', 'cv', 'cy', 'da', 'de', 'de-at', 'de-ch', 'de-formal', 'din', 'diq', 'dsb', 'dtp', 'dty', 'dz', 'ee', 'egl', 'el', 'eml', 'en', 'en-ca', 'en-gb', 'en-ie', 'en-us', 'eo', 'es', 'es-419', 'es-formal', 'et', 'eu', 'ext', 'ff', 'fi', 'fil', 'fit', 'fiu-vro', 'fj', 'fkv', 'fo', 'fr', 'frc', 'fro', 'frp', 'frr', 'fur', 'fy', 'ga', 'gag', 'gan', 'gan-hans', 'gan-hant', 'gcf', 'gcr', 'gd', 'gl', 'gn', 'gom', 'gom-deva', 'gom-latn', 'gor', 'got', 'grc', 'gsw', 'gu', 'gv', 'ha', 'hak', 'haw', 'hi', 'hif', 'hif-deva', 'hif-latn', 'hil', 'hmn', 'ho', 'hr', 'hrx', 'hsb', 'ht', 'hu', 'hu-formal', 'hy', 'hyw', 'hz', 'ia', 'id', 'ie', 'ig', 'ii', 'ik', 'ike-cans', 'ike-latn', 'ilo', 'inh', 'io', 'is', 'it', 'iu', 'ja', 'jam', 'jbo', 'jut', 'jv', 'ka', 'kaa', 'kab', 'kbd', 'kbd-cyrl', 'kbd-latn', 'kbp', 'kea', 'kg', 'ki', 'kiu', 'kj', 'kjp', 'kk', 'kk-cyrl', 'kk-kz', 'kk-latn', 'kk-tr', 'kl', 'km', 'kn', 'ko', 'ko-kp', 'ko-kr', 'koi', 'kr', 'krc', 'kri', 'krj', 'krl', 'ks', 'ks-deva', 'ksh', 'ku', 'ku-latn', 'kum', 'kv', 'kw', 'ky', 'la', 'lad', 'lb', 'lbe', 'lez', 'lfn', 'lg', 'li', 'lij', 'liv', 'lld', 'lmo', 'ln', 'lo', 'loz', 'lt', 'ltg', 'lus', 'lv', 'lzh', 'lzz', 'mai', 'map-bms', 'mdf', 'mg', 'mh', 'mhr', 'mi', 'min', 'mk', 'ml', 'mn', 'mni', 'mnw', 'mo', 'mr', 'mrj', 'ms', 'mt', 'mus', 'mwl', 'my', 'myv', 'na', 'nah', 'nan', 'nap', 'nb', 'nds', 'nds-nl', 'ne', 'new', 'ng', 'niu', 'nl', 'nl-informal', 'nn', 'no', 'nod', 'non', 'nov', 'nrf', 'nrf-fr', 'nrf-gg', 'nrf-je', 'nrm', 'nso', 'nv', 'ny', 'nys', 'oc', 'olo', 'om', 'or', 'os', 'pa', 'pag', 'pam', 'pap', 'pcd', 'pdc', 'pdt', 'pfl', 'pi', 'pih', 'pl', 'pms', 'pnt', 'prg', 'pt', 'pt-br', 'pt-cv', 'pt-pt', 'qu', 'quc', 'qug', 'rgn', 'rif', 'rm', 'rmf', 'rmy', 'rn', 'ro', 'roa-rup', 'roa-tara', 'ru', 'rue', 'rup', 'ruq', 'ruq-cyrl', 'ruq-latn', 'rw', 'rwr', 'sa', 'sah', 'sat', 'sc', 'scd', 'scn', 'sco', 'sdc', 'se', 'sei', 'ses', 'sg', 'sgs', 'sh', 'sh-cyrl', 'sh-latn', 'shi', 'shi-latn', 'shi-tfng', 'shn', 'shy-latn', 'si', 'simple', 'sjd', 'sje', 'sju', 'sk', 'sl', 'sli', 'sm', 'sma', 'smj', 'smn', 'sms', 'sn', 'so', 'sq', 'sr', 'sr-cyrl', 'sr-ec', 'sr-el', 'sr-latn', 'srn', 'srq', 'ss', 'st', 'stq', 'sty', 'su', 'sv', 'sw', 'szl', 'szy', 'ta', 'tay', 'tcy', 'te', 'tet', 'tg', 'tg-cyrl', 'tg-latn', 'th', 'ti', 'tk', 'tl', 'tly', 'tn', 'to', 'tokipona', 'tpi', 'tr', 'tru', 'trv', 'ts', 'tt', 'tt-cyrl', 'tt-latn', 'tum', 'tw', 'ty', 'tyv', 'tzl', 'tzm', 'udm', 'ug-latn', 'uk', 'uz', 'uz-cyrl', 'uz-latn', 've', 'vec', 'vep', 'vi', 'vls', 'vmf', 'vo', 'vot', 'vro', 'wa', 'war', 'wo', 'wuu', 'xal', 'xh', 'xmf', 'xsy', 'yo', 'yue', 'za', 'zea', 'zgh', 'zh', 'zh-classical', 'zh-cn', 'zh-hans', 'zh-hant', 'zh-hk', 'zh-min-nan', 'zh-mo', 'zh-my', 'zh-sg', 'zh-tw', 'zh-wuu', 'zh-yue', 'zu' }
-- Build the inverted map of languages to direction returned by this data module (fast, but collisions are not checked: run the test module) for _, lang in ipairs(rtlLangs) do p[lang] = true end for _, lang in ipairs(ltrLangs) do p[lang] = false end
-- Also store the two lists (at boolean indice), used by the test module to check the inverted map p[true] = rtlLangs p[false] = ltrLangs
return p</text>
<sha1>cxld5o18iaxkhru8z4aje5lec04qed1</sha1>
</revision>
</page>
<page>
<title>Template:SPARQLText</title>
<ns>10</ns>
<id>23033014</id>
<revision>
<id>1399250943</id>
<parentid>1399250772</parentid>
<timestamp>2021-04-10T14:44:00Z</timestamp>
<contributor>
<ip>87.126.92.234</ip>
</contributor>
<comment>Undid revision 1399250772 by 87.126.92.234 (talk)</comment>
<origin>1399250943</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="340" sha1="f35rnwtdn4sdogbp73jb3irfk0cvqp7" xml:space="preserve">{{#if:|
Template:IfTemplate:IfTemplate:IfTemplate:If }}SELECT ?pop WHERE {
wd:Q2807 wdt:P1082 ?pop
}<noinclude>Template:Doc</noinclude></text>
<sha1>f35rnwtdn4sdogbp73jb3irfk0cvqp7</sha1>
</revision>
</page>
<page>
<title>Template:Int try it</title>
<ns>10</ns>
<id>109708780</id>
<redirect title="Template:Int run it" />
<revision>
<id>1764769125</id>
<timestamp>2022-11-04T21:44:15Z</timestamp>
<contributor>
<username>عُثمان</username>
<id>5050751</id>
</contributor>
<comment>عُثمان moved page Template:Int try it to Template:Int run it: the recent change to run it seems fine, but I was confused about where to find the template since the name did not match - move is inaccordance; redirects should resolve</comment>
<origin>1764769125</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="33" sha1="jwzw36nb8jui2zuk88ncwnse88o65qy" xml:space="preserve">#REDIRECT Template:Int run it</text>
<sha1>jwzw36nb8jui2zuk88ncwnse88o65qy</sha1>
</revision>
</page>
<page>
<title>Module:SPARQLMentions</title>
<ns>828</ns>
<id>28161729</id>
<revision>
<id>1453690994</id>
<parentid>661638891</parentid>
<timestamp>2021-07-04T13:54:47Z</timestamp>
<contributor>
<username>Azertus</username>
<id>1229135</id>
</contributor>
<comment>add getTitle</comment>
<origin>1453690994</origin>
<model>Scribunto</model>
<format>text/plain</format>
<text bytes="2760" sha1="lahzcbsmcekjpuk5o23yy8vvav8qfnz" xml:space="preserve">local p = {}
-- Return the label of a given data item, formatted for linking local function getLabel(frame, id, prefix) if prefix == nil then prefix = end if id == "defaultView:BubbleChart" then id = "Q24515280" end if id == "defaultView:Graph" then id = "Q24515287" end if id == "defaultView:Map" then id = "Q24515275" end
if id == "defaultView:ImageGrid" then id = "Q24515278" end
if id == "wikibase:box" then id = "Q26211169" end if id == "wikibase:cornerWest" then id = "Q26211177" end label = mw.wikibase.label( id ) if label == nil then linktext = id extra = else linktext = label .. " (" .. id .. ")" extra = ' ' .. frame:expandTemplate({ title="Reasonator", args= { [1] = id}}) .. ' ' .. frame:expandTemplate({ title="SQID", args= { [1] = id}}) end
link = mw.wikibase.getEntityUrl( id )
return '[' .. link .. ' ' .. linktext .. ']' .. extra; end
local function map(func, array)
local new_array = {}
for i,v in ipairs(array) do
new_array[i] = func(v)
end
return new_array
end
local function getAll(text, regexp, seen, items) if items == nil then items = {} end if seen == nil then seen = {} end for item in string.gmatch(text, regexp) do if seen[item] == nil then seen[item] = 1 table.insert(items, item) end end return items end
-- Produce list of items mentioned in the query
function p.getItems(frame)
if not mw.wikibase then
return "no mw.wikibase"
end
items = getAll(frame.args[1], 'wd:(Q%d+)') return table.concat(map(function(it) return getLabel(frame, it) end, items), ", ") end
-- Produce list of properties mentioned in the query function p.getProperties(frame) if not mw.wikibase then return "no mw.wikibase" end
seen = {} items = {} prefixes = {'wdt', 'p', 'ps', 'pr', 'pq', 'psv', 'pv', 'prv', 'pqv', 'wdtn', 'psn', 'pqn', 'prn', 'wdno' } for _, pr in ipairs(prefixes) do items = getAll(frame.args[1], pr .. ':(P%d+)', seen, items) end return table.concat(map(function(it) return getLabel(frame, it, 'Property:') end, items), ", ") end
function p.getFunctions(frame) if not mw.wikibase then return "no mw.wikibase" end
seen = {} items = {} func = {'defaultView:BubbleChart', 'defaultView:Graph', 'defaultView:Map', 'defaultView:ImageGrid', 'wikibase:box', "wikibase:cornerWest" } for _, pr in ipairs(func) do items = getAll(frame.args[1], pr, seen, items) end return table.concat(map(function(it) return getLabel(frame, it) end, items), ", ") end
function p.getTitle(frame) if not mw.wikibase then return "no mw.wikibase" end
for line in string.gmatch(frame.args[1], "[^%c]+%c?") do local title = string.match(line, '^#title:%s*([^%c]+)')
if not (title == nil) then return title end end end
return p</text>
<sha1>lahzcbsmcekjpuk5o23yy8vvav8qfnz</sha1>
</revision>
</page>
<page>
<title>Template:SQID</title>
<ns>10</ns>
<id>26259378</id>
<revision>
<id>1233859301</id>
<parentid>1227690908</parentid>
<timestamp>2020-07-18T14:13:28Z</timestamp>
<contributor>
<username>MisterSynergy</username>
<id>44949</id>
</contributor>
<comment>move URL to https://sqid.toolforge.org</comment>
<origin>1233859301</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="993" sha1="j6wq5aq6l7wsi92xtysclan6m8dprov" xml:space="preserve"><!--
-->{{#if: | Template:Q  }}<!-- -->{{#if: | Template:P  }}<!-- -->{{#if: | <span class="plainlinks">[https://sqid.toolforge.org/#{{#if:
| /view?id={{#if:
|
| {{#if:
| Q{{#titleparts:}}
| P{{#titleparts:}}
}}
}}&lang=⧼Lang⧽
| /?lang=⧼Lang⧽
}} ]</span>
}}<!-- --><nowiki/>?lang=⧼Lang⧽ }}<!-- --><noinclude>Template:Documentation</noinclude></text>
<sha1>j6wq5aq6l7wsi92xtysclan6m8dprov</sha1>
</revision>
</page>
<page>
<title>Template:Reasonator</title>
<ns>10</ns>
<id>17365939</id>
<revision>
<id>1556587517</id>
<parentid>1507464031</parentid>
<timestamp>2022-01-05T12:35:07Z</timestamp>
<contributor>
<username>Venca24</username>
<id>103280</id>
</contributor>
<comment>+ cs, eo</comment>
<origin>1556587517</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="882" sha1="ej9pd5v5fuipsemxo8gx8dbsqgg5vij" xml:space="preserve">{{#if:
| <span class="plainlinks">[7]</span> }} Template:TranslateThis<noinclude>Template:Documentation</noinclude></text>
<sha1>ej9pd5v5fuipsemxo8gx8dbsqgg5vij</sha1>
</revision>
</page>
<page>
<title>Template:WikiProject</title>
<ns>10</ns>
<id>21790485</id>
<revision>
<id>2298079997</id>
<parentid>2053606357</parentid>
<timestamp>2025-01-14T09:49:46Z</timestamp>
<contributor>
<username>Mormegil</username>
<id>28758</id>
</contributor>
<comment>+cs</comment>
<origin>2298079997</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="2446" sha1="afrxihplnkiijrydcgi7kwzg00a84sv" xml:space="preserve"><noinclude>Template:Doc</noinclude><!--
-->{{#ifexist: Wikidata:WikiProject <!--
#then:
-->|{{#if:<!--
#then:
-->|Template:Section link<!--
#else:
-->|Template:Ll<!--
-->}}<!--
#else:
-->|{{error<!--
-->|Template:TranslateThis<!--
-->}}<!--
--> <small>Template:TranslateThis<!--
--></small><!--
-->}}</text>
<sha1>afrxihplnkiijrydcgi7kwzg00a84sv</sha1>
</revision>
</page>
<page>
<title>Template:WikiProject/pagename</title>
<ns>10</ns>
<id>22491841</id>
<revision>
<id>1294585707</id>
<parentid>238479307</parentid>
<timestamp>2020-10-19T21:05:53Z</timestamp>
<contributor>
<username>Tacsipacsi</username>
<id>33956</id>
</contributor>
<comment>substitute template that doesn’t do what its name suggests and what it does in other projects</comment>
<origin>1294585707</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="60" sha1="8o2k69wu2sme8f490aakwi7ynj63jjv" xml:space="preserve">{{#if:|Wikidata Talk|Wikidata}}:WikiProject {{{1}}}</text>
<sha1>8o2k69wu2sme8f490aakwi7ynj63jjv</sha1>
</revision>
</page>
<page>
<title>Template:ItemOrNot</title>
<ns>10</ns>
<id>28161695</id>
<revision>
<id>361346548</id>
<parentid>361300782</parentid>
<timestamp>2016-08-02T21:22:10Z</timestamp>
<contributor>
<username>Smalyshev (WMF)</username>
<id>1482806</id>
</contributor>
<origin>361346548</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="384" sha1="230nkvb4w9pmw09vu3optxajqkjdr42" xml:space="preserve">{{#if: | * {{{1}}}: | }}<noinclude>
<templatedata> { "params": { "1": { "label": "List item name", "type": "string", "required": true }, "2": { "description": "List item contents", "type": "string" } }, "description": "Displays list item if second argument is not empty, otherwise nothing", "format": "block" } </templatedata> </noinclude></text>
<sha1>230nkvb4w9pmw09vu3optxajqkjdr42</sha1>
</revision>
</page>
<page>
<title>Template:Int Properties</title>
<ns>10</ns>
<id>25945270</id>
<revision>
<id>360948553</id>
<parentid>360948486</parentid>
<timestamp>2016-07-31T15:39:37Z</timestamp>
<contributor>
<username>Airon90</username>
<id>4782</id>
</contributor>
<origin>360948553</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="63" sha1="1f6bvc59pk8lngjngkff5ej07hrd17a" xml:space="preserve"><noinclude>Template:Doc</noinclude>Template:Capitalize</text>
<sha1>1f6bvc59pk8lngjngkff5ej07hrd17a</sha1>
</revision>
</page>
<page>
<title>Template:Int properties</title>
<ns>10</ns>
<id>25941214</id>
<revision>
<id>2504115378</id>
<parentid>2438818739</parentid>
<timestamp>2026-06-10T11:28:12Z</timestamp>
<contributor>
<username>مواطن تونسي</username>
<id>1537128</id>
</contributor>
<minor/>
<comment>traduction ar</comment>
<origin>2504115378</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="746" sha1="ao6colplfei84pspf07jmngpp7arssr" xml:space="preserve"><noinclude>Template:Doc</noinclude>Template:TranslateThis</text>
<sha1>ao6colplfei84pspf07jmngpp7arssr</sha1>
</revision>
</page>
<page>
<title>Template:SPARQL2/doc</title>
<ns>10</ns>
<id>35750675</id>
<revision>
<id>1425856775</id>
<parentid>1425856600</parentid>
<timestamp>2021-05-21T17:39:04Z</timestamp>
<contributor>
<username>PAC2</username>
<id>4892</id>
</contributor>
<comment>/* See also */ typo</comment>
<origin>1425856775</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="533" sha1="p2irk8qhdq7sqdc2n9kyjs3lvi2j5kw" xml:space="preserve"><nowiki>Template loop detected: Template:SPARQL2</nowiki>
Template loop detected: Template:SPARQL2
<nowiki>Template loop detected: Template:SPARQL2</nowiki>
Template loop detected: Template:SPARQL2
<nowiki>Template loop detected: Template:SPARQL2</nowiki>
Template loop detected: Template:SPARQL2
<nowiki>Template loop detected: Template:SPARQL2</nowiki>
Template loop detected: Template:SPARQL2
See also
<sha1>p2irk8qhdq7sqdc2n9kyjs3lvi2j5kw</sha1>
</revision>
</page>
<page>
<title>Template:Int run it</title>
<ns>10</ns>
<id>25022557</id>
<revision>
<id>2438820809</id>
<parentid>2033139854</parentid>
<timestamp>2025-12-06T14:46:20Z</timestamp>
<contributor>
<username>YeBoy371</username>
<id>2200680</id>
</contributor>
<origin>2438820809</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="1085" sha1="8ggotttekjqxrksv8jgpqj8yv3lzvla" xml:space="preserve"><noinclude>Template:Doc</noinclude>Template:TranslateThis</text>
<sha1>8ggotttekjqxrksv8jgpqj8yv3lzvla</sha1>
</revision>
</page>
</mediawiki>
<nowiki><mediawiki xmlns="http://www.mediawiki.org/xml/export-0.11/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.11/ http://www.mediawiki.org/xml/export-0.11.xsd" version="0.11" xml:lang="en">
<siteinfo> <sitename>Wikidata</sitename> <dbname>wikidatawiki</dbname> <base>https://www.wikidata.org/wiki/Wikidata:Main_Page</base> <generator>MediaWiki 1.47.0-wmf.17</generator> <case>first-letter</case> <namespaces> <namespace key="-2" case="first-letter">Media</namespace> <namespace key="-1" case="first-letter">Special</namespace> <namespace key="0" case="first-letter" /> <namespace key="1" case="first-letter">Talk</namespace> <namespace key="2" case="first-letter">User</namespace> <namespace key="3" case="first-letter">User talk</namespace> <namespace key="4" case="first-letter">Wikidata</namespace> <namespace key="5" case="first-letter">Wikidata talk</namespace> <namespace key="6" case="first-letter">File</namespace> <namespace key="7" case="first-letter">File talk</namespace> <namespace key="8" case="first-letter">MediaWiki</namespace> <namespace key="9" case="first-letter">MediaWiki talk</namespace> <namespace key="10" case="first-letter">Template</namespace> <namespace key="11" case="first-letter">Template talk</namespace> <namespace key="12" case="first-letter">Help</namespace> <namespace key="13" case="first-letter">Help talk</namespace> <namespace key="14" case="first-letter">Category</namespace> <namespace key="15" case="first-letter">Category talk</namespace> <namespace key="120" case="first-letter">Property</namespace> <namespace key="121" case="first-letter">Property talk</namespace> <namespace key="122" case="first-letter">Query</namespace> <namespace key="123" case="first-letter">Query talk</namespace> <namespace key="146" case="first-letter">Lexeme</namespace> <namespace key="147" case="first-letter">Lexeme talk</namespace> <namespace key="640" case="first-letter">EntitySchema</namespace> <namespace key="641" case="first-letter">EntitySchema talk</namespace> <namespace key="710" case="first-letter">TimedText</namespace> <namespace key="711" case="first-letter">TimedText talk</namespace> <namespace key="828" case="first-letter">Module</namespace> <namespace key="829" case="first-letter">Module talk</namespace> <namespace key="1198" case="first-letter">Translations</namespace> <namespace key="1199" case="first-letter">Translations talk</namespace> <namespace key="1728" case="first-letter">Event</namespace> <namespace key="1729" case="first-letter">Event talk</namespace> <namespace key="2600" case="first-letter">Topic</namespace> </namespaces> </siteinfo> <page> <title>Template:SPARQL2</title> <ns>10</ns> <id>28161690</id> <revision> <id>2346047691</id> <parentid>2346040648</parentid> <timestamp>2025-05-08T12:02:25Z</timestamp> <contributor> <username>Madamebiblio</username> <id>2952832</id> </contributor> <minor/> <comment>Reverted edits by 201.143.205.181 (talk) to last revision by Kokage si</comment> <origin>2294596805</origin> <model>wikitext</model> <format>text/x-wiki</format> <text bytes="7567" sha1="s4975lvx7s2i4pjji1govtxccu2rt3e" xml:space="preserve">Template:SPARQL2/doc
<onlyinclude>Template:Clear{{#ifeq:|{{{nohints}}}| <!--hidden hints--> | {{TranslateThis<!--
-->|ar=يستخدم الاستعلام التالي هذه:<!--
-->|be-tarask=Дадзены запыт выкарыстоўвае:<!--
-->|cs=Následující dotaz používá:<!--
-->|de=Die Suchanfrage verwendet:<!--
-->|en=The following query uses these:<!--
-->|en-gb=The following query uses these:<!--
-->|el=Το ακόλουθο ερώτημα χρησιμοποιεί αυτά:<!--
-->|es=La siguiente consulta utiliza lo siguiente:<!--
-->|fi=Seuraava kysely käyttää näitä:<!--
-->|fr=La requête suivante utilise ces :<!--
-->|hu=Ez a lekérdezés a következőket használja:<!--
-->|id=Kueri di bawah akan menggunakan entitas berikut:<!--
-->|it=La seguente query utilizza questi:<!--
-->|ja=以下のクエリではこれらを使用します:<!--
-->|nl=Deze query gebruikt:<!--
-->|pl=To zapytanie używa:<!--
-->|pt=A consulta seguinte utiliza estes:<!--
-->|pt-br=A consulta seguinte utiliza estes:<!--
-->|ru=Этот запрос использует:<!--
-->|sv=Följande fråga använder dessa:<!--
-->|tr=Aşağıdaki sorgu bunları kullanıyor:<!--
-->|uk=Цей запит використовує:<!--
-->}}<!-- -->Template:ItemOrNot <!-- -->Template:ItemOrNot <!-- -->Template:ItemOrNot <!--
-->}}
[[:Template:SPARQLText]]
<!-- --><div class="displayonly">{{#if: ||Template:Int try it}}</div>Template:Clear</onlyinclude><noinclude> <templatedata> { "params": { "query": { "required": true, "label": { "ar": "استعلام", "be-tarask": "запыт", "cs": "dotaz", "en": "query", "es": "consulta", "fr": "requête", "id": "kueri", "it": "query", "ja": "クエリ", "pl": "zapytanie", "pt": "consulta", "pt-br": "consulta", "sv": "fråga",
"tr": "sorgu",
"uk": "запит" }, "description": { "ar": "استعلام سباركل", "be-tarask": "запыт SPARQL", "cs": "SPARQL dotaz", "en": "SPARQL query", "es": "consulta SPARQL", "fr": "la requête que le modèle doit traiter et afficher", "id": "kueri SPARQL", "it": "query SPARQL", "ja": "SPARQLクエリ", "pl": "query SPARQL", "pt": "consulta SPARQL", "pt-br": "consulta SPARQL", "sv": "SPARQL fråga", "tr": "SPARQL sorgusu", "uk": "запит SPARQL" }, "example": { "be-tarask": "SELECT * WHERE { ?x wdt:P31 wd:Q5 } LIMIT 1", "cs": "SELECT * WHERE { ?x wdt:P31 wd:Q5 } LIMIT 1", "en": "SELECT * WHERE { ?x wdt:P31 wd:Q5 } LIMIT 1", "es": "SELECT ?item WHERE { ?item wdt:P31 wd:Q5 } LIMIT 1", "fr": "select ?item where { ?item wdt:P31 wd:Q5 } LIMIT 1", "id": "SELECT * WHERE { ?a wdt:P31 wd:Q5 } LIMIT 1", "it": "select ?item where { ?item wdt:P31 wd:Q5 } LIMIT 1", "pt": "select ?item where { ?item wdt:P31 wd:Q5 } LIMIT 1", "pt-br": "select ?item where { ?item wdt:P31 wd:Q5 } LIMIT 1" }, "type": "string", "aliases": [ "sparql" ], "suggested": true }, "extraprefix": { "description": { "ar": "بادئات إضافية لإضافتها",
"be-tarask": "дадатковыя прэфіксы (неабавязковыя)",
"cs": "Dodatečné prefixy (volitelné)", "en": "Extra prefixes to be added", "es": "Prefijos extra a añadir (opcional)", "fr": "les préfixes SPARQL non standards ou inconnus du service de requête éventuellement nécessaires (optionnel)", "id": "Prefiks SPARQL yang akan ditambahkan", "it": "Aggiungere i prefissi SPARQL non standard o sconosciuti eventualmente necessari (opzionale)", "ja": "追加する接頭辞(オプション)", "pl": "Dodatkowe prefiksy (opcjonalnie)", "pt": "Adicionar os prefixos SPARQL não padrões ou desconhecidos eventualmente necessários (opcional)", "pt-br": "Adicionar os prefixos SPARQL não padrões ou desconhecidos eventualmente necessários (opcional)", "uk": "Додаткові префікси (необов'язкові)" }, "example": "PREFIX wikibase: <http://wikiba.se/ontology#>", "type": "string" } }, "description": {
"be-tarask": "Гэты шаблён выводзіць запыт SPARQL з падсьветкай сынтаксісу, выкарыстаных элемэнтаў і спасылак на WDQS дзеля запуску запыту. \nЗРАБІЦЬ: скарыстаныя меткі элемэнтаў не лякалізаваныя",
"cs": "Tato šablona zobrazuje SPARQL dotaz ze zvýrazněnou syntaxí, použité položky a odkaz na WDQS dotazovací službu pro vyzkoušení.", "en": "This template displays SPARQL query with syntax highlighting, used items and link to WDQS query site to run the query. \nTODO: used items labels are not localized", "es": "Esta plantilla muestra una consulta SPARQL con resaltado de sintaxis, los items utilizados y un enlace al WDQS para lanzar la consulta", "fr": "Ce modèle affiche une requête SPARQL et permet de la lancer au travers du service de requête Wikidata. Il affiche aussi quelques informations basiques sur les éléments et fonctionnalités utilisées par cette requête", "id": "Templat ini menampilkan kueri SPARQL dengan pembedaan warna pada sintaks beserta entitas Wikidata yang digunakan dan pranala kueri di WDQS.", "it": "Questo template mostra una query SPARQL evidenziandone la sintassi e gli elementi usati e fornisce un link alla query WDQS site che permette di lanciare la query", "ja": "このテンプレートは構文強調付きのSPARQLクエリ、使用した項目、クエリを実行するWDQSクエリサイトへのリンクを表示します。", "pl": "Szablon wyświetla zapytanie SPARQL z podświetlaniem składni, listą użytych elementów i linkiem do WDQS.", "pt": "Esta predefinição mostra uma consulta SPARQL na qual evidencia a sintaxe e os elementos usados e fornece um enlace ao site WDQS que permite executar a consulta", "pt-br": "Esta predefinição mostra uma consulta SPARQL na qual evidencia a sintaxe e os elementos usados e fornece um enlace ao site WDQS que permite executar a consulta", "sv": "Denna mall visar en SPARQL fråga med syntaxfärgning, använda objekt och länk till WDQS frågesajten för att köra frågan. \nTODO: använda objekts etiketter är inte lokaliserade", "uk": "Цей шаблон показує запит SPARQL з підсвічуванням елементів синтаксису, список використаних елементів і посилання на сайт WDQS-запиту." }, "paramOrder": [ "query", "extraprefix" ], "format": "block" } </templatedata> </noinclude></text>
<sha1>s4975lvx7s2i4pjji1govtxccu2rt3e</sha1>
</revision>
</page>
<page>
<title>Template:Template</title>
<ns>10</ns>
<id>12414</id>
<redirect title="Template:Tl" />
<revision>
<id>431881</id>
<parentid>312894</parentid>
<timestamp>2012-11-13T02:07:50Z</timestamp>
<contributor>
<username>~riley</username>
<id>2219</id>
</contributor>
<comment>http://en.wikipedia.org/w/index.php?title=Template:Template&action=edit</comment>
<origin>431881</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="25" sha1="cdpzj9yp99pn5v093b404f4sc7cybv1" xml:space="preserve">#REDIRECT Template:Tl</text>
<sha1>cdpzj9yp99pn5v093b404f4sc7cybv1</sha1>
</revision>
</page>
<page>
<title>Template:Tl</title>
<ns>10</ns>
<id>3170</id>
<revision>
<id>2508986920</id>
<parentid>1946850712</parentid>
<timestamp>2026-06-22T01:25:21Z</timestamp>
<contributor>
<username>RogueScholar</username>
<id>3003918</id>
</contributor>
<minor/>
<comment>Format template code for readability and convert numeric HTML entities to named equivalents to accomplish the same</comment>
<origin>2508986920</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="1299" sha1="dqel96mgakegupz568kpnt91rdib9m4" xml:space="preserve"><includeonly><code>{{{{#if:|subst:}}<!-- Begin evaluation of first parameter.
-->{{#ifeq:{|:|:[[]]|<!-- If already prefixed by colon, show the link as such, too.
-->{{#switch:<!-- Target's namespace determines the link format. -->
| | Template = [[Template:|]]<!-- Main: (absent) or Template: namespaces -->
| File | Category = [[:{{{1}}}]]<!-- File and Category namespaces receive hidden colon prefix. -->
| #default = [[{{{1}}}]]<!-- All others are linked verbatim.
-->}}<!-- End of switch function. -->}}<!-- End of first parameter evaluation.
-->{{#ifeq: {{{2}}}| x||{{{2}}}}}<!--
-->{{#ifeq: {{{3}}}| x||{{{3}}}}}<!--
-->{{#ifeq: {{{4}}}| x||{{{4}}}}}<!--
-->{{#ifeq: {{{5}}}| x||{{{5}}}}}<!--
-->{{#ifeq: {{{6}}}| x||{{{6}}}}}<!--
-->{{#ifeq: {{{7}}}| x||{{{7}}}}}<!--
-->{{#ifeq: {{{8}}}| x||{{{8}}}}}<!--
-->{{#ifeq: {{{9}}}| x||{{{9}}}}}<!--
-->{{#ifeq:{{{10}}}|x||{{{10}}}}}}}</code></includeonly><noinclude>
Template:Documentation</noinclude></text>
<sha1>dqel96mgakegupz568kpnt91rdib9m4</sha1>
</revision>
</page>
<page>
<title>Template:Capitalize</title>
<ns>10</ns>
<id>24835143</id>
<revision>
<id>2283223741</id>
<parentid>2282968755</parentid>
<timestamp>2024-12-03T22:55:49Z</timestamp>
<contributor>
<username>Tacsipacsi</username>
<id>33956</id>
</contributor>
<comment>Undid revision 2282968755 by 2806:2F0:A080:F124:78E9:9300:6983:EA83 (talk): ???</comment>
<origin>2283223741</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="100" sha1="08bgnnmlolmwjwag381zkq615fl2s0a" xml:space="preserve"><includeonly>Script error: No such module "Capitalize".</includeonly><noinclude>
Template:Doc </noinclude></text>
<sha1>08bgnnmlolmwjwag381zkq615fl2s0a</sha1>
</revision>
</page>
<page>
<title>Template:Int items</title>
<ns>10</ns>
<id>28641837</id>
<revision>
<id>2438810545</id>
<parentid>2208740771</parentid>
<timestamp>2025-12-06T14:15:50Z</timestamp>
<contributor>
<username>YeBoy371</username>
<id>2200680</id>
</contributor>
<origin>2438810545</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="475" sha1="knyh87z85w0os01yxpmvrzvlnwf07fb" xml:space="preserve"><noinclude>Template:Doc</noinclude>Template:TranslateThis</text>
<sha1>knyh87z85w0os01yxpmvrzvlnwf07fb</sha1>
</revision>
</page>
<page>
<title>Module:Capitalize</title>
<ns>828</ns>
<id>25940912</id>
<revision>
<id>333880118</id>
<parentid>327538585</parentid>
<timestamp>2016-05-08T21:08:10Z</timestamp>
<contributor>
<username>TomT0m</username>
<id>7333</id>
</contributor>
<comment>cap after the tags</comment>
<origin>333880118</origin>
<model>Scribunto</model>
<format>text/plain</format>
<text bytes="518" sha1="oi3oo9q42s5okxrm5hbfy01zk32pehp" xml:space="preserve">
local p = {}
function p.cap(str) lang = mw.getContentLanguage() if lang:ucfirst(str) ~= str then return lang:ucfirst(str) else local substr = mw.ustring.sub b, e = mw.ustring.find(str, ">%s*%a") while e ~= nil do if mw.ustring.find(">", substr(str, b,e)) == nil then return substr(str, 1, e-1) .. lang:ucfirst(substr(str,e,e)) ..substr(str, e+1) end b, e = mw.ustring.find(str, ">%s*%a", e) end return str end end
function p.capitalize(frame) return p.cap(frame.args[1]) end
return p</text>
<sha1>oi3oo9q42s5okxrm5hbfy01zk32pehp</sha1>
</revision>
</page>
<page>
<title>Template:Clear</title>
<ns>10</ns>
<id>12131100</id>
<revision>
<id>665474881</id>
<parentid>91992232</parentid>
<timestamp>2018-04-14T18:59:12Z</timestamp>
<contributor>
<username>Dataeast0000001</username>
<id>2952466</id>
</contributor>
<comment>move onlyinclude to noinclude</comment>
<origin>665474881</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="79" sha1="5aa2j06l3n3husy1g6jggf6oznzocau" xml:space="preserve"><div style="clear:both;"></div><noinclude>Template:Documentation</noinclude></text>
<sha1>5aa2j06l3n3husy1g6jggf6oznzocau</sha1>
</revision>
</page>
<page>
<title>Module:Fallback</title>
<ns>828</ns>
<id>19181086</id>
<revision>
<id>714642825</id>
<parentid>714642495</parentid>
<timestamp>2018-07-23T16:35:03Z</timestamp>
<contributor>
<username>Matěj Suchánek</username>
<id>53613</id>
</contributor>
<minor/>
<comment>fix</comment>
<origin>714642825</origin>
<model>Scribunto</model>
<format>text/plain</format>
<text bytes="5559" sha1="6vr2in87podxnsj3x2jttt1r1qisf9q" xml:space="preserve">local p = {}
function p.fblist(lang, langonly) -- list the full fallback chain from a language to en local fbtable = mw.language.getFallbacksFor(lang) table.insert(fbtable, 1, lang) if not langonly then table.insert(fbtable, 'message') table.insert(fbtable, 'item') table.insert(fbtable, 'default') end return fbtable end
function p._langSwitch(args, lang) -- args: table of translations -- Return error if there is not default and no English version -- otherwise returns the message in the most appropriate, plus the lang code as a second value if not args.en and not args.default and not args.message and not args.item and args.nocat ~= '1' then return error("langSwitch error: no default") end -- get language (either stated one or user's default language) if not lang then return '<strong class="error">LangSwitch Error: no lang</strong>' -- must become proper error end -- get the list of acceptable language (lang + those in lang's fallback chain) and check their content for i, j in ipairs(p.fblist(lang)) do if args[j] then if args[j] == '~' then return nil, j end if j == 'item' then local label, lang = mw.wikibase.getLabelWithLang(args[j]) if label then return label, lang else return args[j], 'en' end end if j == 'message' then return tostring(mw.message.new(args[j]):inLanguage(lang)) end -- if this is an interface message if args[j] ~= then return args[j], j end end end return nil end
function p.langSwitch(frame) -- version to be used from wikitext local args = frame.args -- if no expected args provided than check parent template/module args if not args.en and not args.default and not args.nocat then args = frame:getParent().args end local lang if args.lang and args.lang ~= then lang = args.lang args.lang = nil else -- get user's chosen language lang = frame:preprocess( "⧼lang⧽" ) end local str, language = p._langSwitch(args, lang) return str -- get the first value of the langSwitch, (the text) not the second (the language) end
function p.fallbackpage(base, lang, formatting) local languages = p.fblist(lang) for i, lng in ipairs(languages) do if mw.title.new(base .. '/' .. lng).exists then if formatting == 'table' then return {base .. '/' .. lng, lng} -- returns name of the page + name of the language else return base .. '/' .. lng -- returns only the page end end end return base end
function p.autotranslate(frame) -- logic for template:Autotranslate local args = frame.args if not args.lang or args.lang == then args.lang = frame:preprocess( "⧼lang⧽" ) -- get user's chosen language end
-- find base page local base = args.base if not base or base == then return '<strong class="error">Base page not provided for autotranslate</strong>' end if string.sub(base, 2, 9) ~= 'emplate:' then base = 'Template:' .. base -- base provided without 'Template:' part end
-- find base template language subpage local page = p.fallbackpage(base, args.lang) -- if (not page and base ~= args.base) then -- try the original args.base string. This case is only needed if base is not in template namespace page = p.fallbackpage(args.base, args.lang) end if not page then return string.format('<strong class="error">no fallback page found for autotranslate (base=%s, lang=%s)</strong>', args.base, args.lang) end
-- repack args in a standard table local newargs = {} for field, value in pairs(args) do if field ~= 'base' then newargs[field] = value end end
-- Transclude Template:Page with template arguments the same as the ones passed to Template:Autotranslate template. return frame:expandTemplate{ title = page, args = newargs } end
function p.translate(page, key, lang) --translate data stored in a module if type(page) == 'string' then -- if the requested translation table is not yet loaded page = require('Module:' .. page) end
local val if page[key] then val = page[key] elseif page.keys and page.keys[key] then-- key 'keys" is an index of all keys, including redirects, see Module:i18n/datatype val = page.keys[key] end if not val then return '<' .. key .. '>' end return p._langSwitch(val, lang) end
function p.translatelua(frame) local lang = frame.args.lang local page = require('Module:' .. mw.text.trim(frame.args[1])) -- page should only contain a simple of translations if not lang or mw.text.trim(lang) == then lang = frame:preprocess( "⧼lang⧽" ) end if frame.args[2] then page = page[mw.text.trim(frame.args[2])] end return p._langSwitch(page, lang) end
function p.runTests() local toFallbackTest = require('Module:Fallback/tests/fallbacks') local result = true
mw.log('Testing fallback chains') for i, t in ipairs(toFallbackTest) do local fbtbl = table.concat(p.fblist(t.initial), ', ') local expected = table.concat(t.expected, ', ') local ret = (fbtbl == expected) mw.log(i, ret and 'passed' or 'FAILED', t.initial, (not ret) and ('FAILED\nis >>' .. fbtbl .. '<<\nbut should be >>' .. expected .. '<<\n') or ) result = result and ret end
return result end
function p.showTemplateArguments(frame) -- list all input arguments of the template that calls "Script error: No such module "Fallback"." local str = for name, value in pairs( frame:getParent().args ) do if str == then str = string.format('%s=%s', name, value) -- argument #1 else str = string.format('%s, %s=%s', str, name, value) -- the rest end end return str end
return p</text>
<sha1>6vr2in87podxnsj3x2jttt1r1qisf9q</sha1>
</revision>
</page>
<page>
<title>Template:Ll</title>
<ns>10</ns>
<id>3264473</id>
<revision>
<id>618665821</id>
<parentid>443393354</parentid>
<timestamp>2018-01-11T02:59:59Z</timestamp>
<contributor>
<username>Jarekt</username>
<id>1274</id>
</contributor>
<comment>Fulfilling edit request by User:Kaganer. Thanks for helping!</comment>
<origin>618665821</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="178" sha1="h8s4unutwk14jcbyfcq88r5yvqbu5x5" xml:space="preserve">[[Special:MyLanguage/{{{1}}}{{#if:|#{{{anchor}}}}}|Template:PDT</includeonly>]]<noinclude>
Template:Documentation </noinclude></text>
<sha1>h8s4unutwk14jcbyfcq88r5yvqbu5x5</sha1>
</revision>
</page>
<page>
<title>Template:TranslateThis</title>
<ns>10</ns>
<id>16552759</id>
<revision>
<id>483148362</id>
<parentid>483129342</parentid>
<timestamp>2017-05-08T01:54:31Z</timestamp>
<contributor>
<username>MKar</username>
<id>6110</id>
</contributor>
<minor/>
<comment>Undid revision 483129342 by 70.71.90.6 (talk)</comment>
<origin>483148362</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="97" sha1="rm4lztokzfib496c8sbt9q36vx6n9tz" xml:space="preserve"><includeonly>Script error: No such module "TranslateThis".</includeonly><noinclude>Template:Documentation</noinclude></text>
<sha1>rm4lztokzfib496c8sbt9q36vx6n9tz</sha1>
</revision>
</page>
<page>
<title>Module:TranslateThis</title>
<ns>828</ns>
<id>16552706</id>
<revision>
<id>2144500220</id>
<parentid>1980692436</parentid>
<timestamp>2024-05-04T13:29:50Z</timestamp>
<contributor>
<username>Uzume</username>
<id>11596</id>
</contributor>
<comment>switch frame:preprocess("⧼lang⧽") to callParserFunction("int", "lang")</comment>
<origin>2144500220</origin>
<model>Scribunto</model>
<format>text/plain</format>
<text bytes="1738" sha1="j2it1vjxk477pw54t7yheap3g9xt452" xml:space="preserve">local fb = require('Module:Fallback')
local dir = require('Module:Dir')
return { main = function( frame )
local function shallowcopy(orig) if type(orig) ~= 'table' then return orig end
local result = {} for key, value in pairs(orig) do result[key] = value end return result end
local args = shallowcopy(frame:getParent().args) local lang = args.lang or frame:callParserFunction("int", "lang") -- I don't know of any other way to get the user's language... args.lang = nil
local anchor = args.anchor args.anchor = nil if (anchor and args[anchor]) then anchor = args[anchor] end anchor = anchor and frame:expandTemplate( { title = "Anchor", args = { anchor } } ) or
local result = args[ lang ] if result and result ~= then result = '<span dir="' .. dir.select(lang, 'rtl', 'ltr') .. '" lang="' .. lang .. '">' .. result .. '</span>' else local default = {} for i, v in pairs( args ) do if v ~= "" then table.insert(default, '<span dir="' .. dir.select(i, 'rtl', 'ltr') .. '" lang="' .. i .. '">' .. v .. '</span> <small>(' .. i .. ')</small>') end end default = table.concat(default, ' / ') args.default=default local newlang result, newlang = fb._langSwitch(args, lang) if not newlang then result = elseif newlang~='default' then result = '<span dir="' .. dir.select(newlang, 'rtl', 'ltr') .. '" lang="' .. newlang .. '">' .. result .. '</span> <small>(' .. newlang .. ')</small>' end local langname = mw.language.fetchLanguageName( lang, lang ) if langname ~= "" and newlang then result = result .. " – " .. frame:expandTemplate( { title = "Help translate", args = { langname, lang = lang } } ) end end
return anchor .. result end}</text>
<sha1>j2it1vjxk477pw54t7yheap3g9xt452</sha1>
</revision>
</page>
<page>
<title>Module:Dir</title>
<ns>828</ns>
<id>95388294</id>
<revision>
<id>1935187194</id>
<parentid>1935159027</parentid>
<timestamp>2023-07-15T22:41:28Z</timestamp>
<contributor>
<username>Tacsipacsi</username>
<id>33956</id>
</contributor>
<comment>Undid revision 1935159027 by 177.232.91.83 (talk): test edit</comment>
<origin>1935187194</origin>
<model>Scribunto</model>
<format>text/plain</format>
<text bytes="5612" sha1="n6dnippb8dl8nupbrxgqviac0hno50v" xml:space="preserve">-- This module implements Template:Dir.
-- local rtlOverrides = mw.loadData('Module:Dir/RTL overrides') -- !!! mw.loadData() is currently broken, it does NOT load anything local rtlOverrides = require('Module:Dir/RTL overrides') local p = {}
local function trim(s)
if s and s ~= then s = tostring(s):match('^%s*(.-)%s*$') end
if s == then return nil end
return s
end
function p.rtlLangs(isRTL)
if isRTL == nil then isRTL = true end
return rtlOverrides[isRTL] or {}
end
function p.isRTL(code)
if type(code) ~= 'string' then return nil end
local v = rtlOverrides[code] -- very fast and not limited in the number of supported languages
if v ~= nil then return v end -- return it if mapped, otherwise use MediaWiki library:
local success, ret = pcall(function ()
return mw.language.new(code):isRTL() -- expensive and limited to 20 languages per MediaWiki instance
end)
return success and ret
end
function p.select(code, rtl, ltr)
if p.isRTL(code) then
return rtl
else
return ltr
end
end
-- Used via a template Template:Dir -- which just calls Script error: No such module "Dir"., the 3 parameters are automatically trimmed: -- Parameter 1 takes the default value from ⧼Lang⧽ if it's empty or not specified. -- Parameter 2 can be named rtl, may be explicitly empty, otherwise takes the default value 'rtl' only if it's not specified. -- Parameter 3 can be named ltr, may be explicitly empty, otherwise takes the default value 'ltr' only if it's not specified. function p.main(frame)
local args = frame:getParent().args -- Parameters used to transclude Template:Dir
local code = trim(args[1]) or frame:callParserFunction('Int', 'Lang')
local rtl = trim(args.rtl or args[2] or 'rtl')
local ltr = trim(args.ltr or args[3] or 'ltr')
return p.select(code, rtl, ltr)
end
setmetatable(p, { quickTests = function ()
local rtlLangs = p.rtlLangs(true) local ltrLangs = p.rtlLangs(false)
-- Basic check of data format
local function checkLangs(name, langs)
for k, lang in pairs(langs) do
assert(type(k) == 'number' and k == math.floor(k)
and type(lang) == 'string' and #lang >= 2 and #lang <= 16
and lang:find('^[a-z][%-0-9a-z]*[0-9a-z]$') == 1,
": Invalid sequence of language codes, " .. name .. "['" .. k .. "'] = '" .. lang .. "'")
end
return true
end
local ok, msg
ok, msg = pcall(checkLangs, 'rtlLangs', rtlLangs)
if not ok then return false, msg end
ok, msg = pcall(checkLangs, 'ltrLangs', ltrLangs)
if not ok then return false, msg end
-- Build inverse maps of languages having each direction
local isrtl, isltr = {}, {}
for _, lang in ipairs(rtlLangs) do isrtl[lang] = true end
for _, lang in ipairs(ltrLangs) do isltr[lang] = true end
-- Check conflicts using the two inverse maps
for _, lang in ipairs(rtlLangs) do
if isltr[lang] then return false, ": Direction conflict for '" .. lang .. "'" end
end
for _, lang in ipairs(ltrLangs) do
if isrtl[lang] then return false, ": Direction conflict for '" .. lang .. "'" end
end
-- Log missing languages (allows filling the tables above) according to MediaWiki internal data
local knownLangs, isKnownLang = mw.language.fetchLanguageNames(), {}
for lang, _ in pairs(knownLangs) do
isKnownLang[lang] = true
if rtlOverrides[lang] == nil then -- only if we still don't have data for this language
-- Note: we cannot check more than 20 languages at once, then MediaWiki raises an error.
-- So this test only runs on the Lua console, where you can update the tables at top.
-- This also means we cannot compare what MediaWiki returns with the direction we map here for all languages.
ok, value = pcall(function() return tostring(mw.language.new(lang):isRTL()) end)
mw.log("Warning: missing direction for language '" .. lang .. "', MediaWiki returns '" .. value .. "'")
end
end
-- utility: reverse order iterator on sequences
local function revipairs(t)
return function(t, i)
i = i - 1
local v = t[i]
if v == nil then return nil end
return i, v
end, t, #t + 1
end
-- Sort and deduplicate language code values (by scanning backward) for data cleanup
-- Also log languages having a direction mapping in this module but still not known by MediaWiki
table.sort(rtlLangs)
table.sort(ltrLangs)
for i, lang in revipairs(rtlLangs) do
if rtlLangs[i - 1] == rtlLangs[i] then table.remove(rtlLangs, i) end
if isKnownLang[lang] == nil then
mw.log("RTL language '" .. lang .. "' still not known by Mediawiki (could be a missing alias or variant)")
end
end
for i, lang in revipairs(ltrLangs) do
if ltrLangs[i - 1] == ltrLangs[i] then table.remove(ltrLangs, i) end
if isKnownLang[lang] == nil then
mw.log("LTR language '" .. lang .. "' still not known by Mediawiki (could be a missing alias or variant)")
end
end
-- Final presentation of current lists, sorted and deduplicated
mw.log("----")
mw.log("local rtlLangs = { '" .. table.concat(rtlLangs, "', '") .. "' }")
mw.log("local ltrLangs = { '" .. table.concat(ltrLangs, "', '") .. "' }")
return true
end }) --[==[ Enter this to run tests in the Lua console: =getmetatable(p).quickTests() --]==]
return p</text>
<sha1>n6dnippb8dl8nupbrxgqviac0hno50v</sha1>
</revision>
</page>
<page>
<title>Module:Dir/RTL overrides</title>
<ns>828</ns>
<id>95388411</id>
<revision>
<id>1223091335</id>
<timestamp>2020-07-03T04:07:06Z</timestamp>
<contributor>
<username>Amitie 10g</username>
<id>185006</id>
</contributor>
<comment>Created page with "local p = {} --[==[ Basic input sequences: relative order or duplicates does not matter here (but the end of the self test displays them sorted and deduplicated), but codes m..."</comment>
<origin>1223091335</origin>
<model>Scribunto</model>
<format>text/plain</format>
<text bytes="4566" sha1="cxld5o18iaxkhru8z4aje5lec04qed1" xml:space="preserve">local p = {}
--[==[ Basic input sequences: relative order or duplicates does not matter here (but the end of the self test displays them sorted and deduplicated), but codes must be valid and belong to only one of the two sequences).
Any missing language code will be checked with mw.language.new(code):isRTL(), which is costly in loaded resources (it can only check 20 languages at most including the content language) So it is best to map all languages that are the most likely to be used. --]==]
local rtlLangs = { 'aeb', 'aeb-arab', 'ar', 'arc', 'arq', 'ary', 'arz', 'azb', 'bcc', 'bgn', 'bqi', 'ckb', 'dv', 'fa', 'fa-af', 'glk', 'ha-arab', 'he', 'khw', 'kk-arab', 'kk-cn', 'ks-arab', 'ku-arab', 'lki', 'lrc', 'luz', 'mzn', 'nqo', 'ota', 'pnb', 'prd', 'ps', 'sd', 'sdh', 'skr', 'skr-arab', 'ug', 'ug-arab', 'ur', 'uz-arab', 'ydd', 'yi' }
local ltrLangs = { 'aa', 'ab', 'abs', 'ace', 'ady', 'ady-cyrl', 'aeb-latn', 'af', 'ak', 'aln', 'als', 'alt', 'am', 'ami', 'an', 'ang', 'anp', 'arn', 'as', 'ase', 'ast', 'atj', 'av', 'avk', 'awa', 'ay', 'az', 'ba', 'ban', 'bar', 'bat-smg', 'bbc', 'bbc-latn', 'bcl', 'be', 'be-tarask', 'be-x-old', 'bg', 'bh', 'bho', 'bi', 'bjn', 'bm', 'bn', 'bo', 'bpy', 'br', 'brh', 'bs', 'btm', 'bto', 'bu', 'bug', 'bxr', 'ca', 'cbk-zam', 'cdo', 'ce', 'ceb', 'ch', 'cho', 'chr', 'chy', 'co', 'cop', 'cps', 'cr', 'crh', 'crh-cyrl', 'crh-latn', 'cs', 'csb', 'cu', 'cv', 'cy', 'da', 'de', 'de-at', 'de-ch', 'de-formal', 'din', 'diq', 'dsb', 'dtp', 'dty', 'dz', 'ee', 'egl', 'el', 'eml', 'en', 'en-ca', 'en-gb', 'en-ie', 'en-us', 'eo', 'es', 'es-419', 'es-formal', 'et', 'eu', 'ext', 'ff', 'fi', 'fil', 'fit', 'fiu-vro', 'fj', 'fkv', 'fo', 'fr', 'frc', 'fro', 'frp', 'frr', 'fur', 'fy', 'ga', 'gag', 'gan', 'gan-hans', 'gan-hant', 'gcf', 'gcr', 'gd', 'gl', 'gn', 'gom', 'gom-deva', 'gom-latn', 'gor', 'got', 'grc', 'gsw', 'gu', 'gv', 'ha', 'hak', 'haw', 'hi', 'hif', 'hif-deva', 'hif-latn', 'hil', 'hmn', 'ho', 'hr', 'hrx', 'hsb', 'ht', 'hu', 'hu-formal', 'hy', 'hyw', 'hz', 'ia', 'id', 'ie', 'ig', 'ii', 'ik', 'ike-cans', 'ike-latn', 'ilo', 'inh', 'io', 'is', 'it', 'iu', 'ja', 'jam', 'jbo', 'jut', 'jv', 'ka', 'kaa', 'kab', 'kbd', 'kbd-cyrl', 'kbd-latn', 'kbp', 'kea', 'kg', 'ki', 'kiu', 'kj', 'kjp', 'kk', 'kk-cyrl', 'kk-kz', 'kk-latn', 'kk-tr', 'kl', 'km', 'kn', 'ko', 'ko-kp', 'ko-kr', 'koi', 'kr', 'krc', 'kri', 'krj', 'krl', 'ks', 'ks-deva', 'ksh', 'ku', 'ku-latn', 'kum', 'kv', 'kw', 'ky', 'la', 'lad', 'lb', 'lbe', 'lez', 'lfn', 'lg', 'li', 'lij', 'liv', 'lld', 'lmo', 'ln', 'lo', 'loz', 'lt', 'ltg', 'lus', 'lv', 'lzh', 'lzz', 'mai', 'map-bms', 'mdf', 'mg', 'mh', 'mhr', 'mi', 'min', 'mk', 'ml', 'mn', 'mni', 'mnw', 'mo', 'mr', 'mrj', 'ms', 'mt', 'mus', 'mwl', 'my', 'myv', 'na', 'nah', 'nan', 'nap', 'nb', 'nds', 'nds-nl', 'ne', 'new', 'ng', 'niu', 'nl', 'nl-informal', 'nn', 'no', 'nod', 'non', 'nov', 'nrf', 'nrf-fr', 'nrf-gg', 'nrf-je', 'nrm', 'nso', 'nv', 'ny', 'nys', 'oc', 'olo', 'om', 'or', 'os', 'pa', 'pag', 'pam', 'pap', 'pcd', 'pdc', 'pdt', 'pfl', 'pi', 'pih', 'pl', 'pms', 'pnt', 'prg', 'pt', 'pt-br', 'pt-cv', 'pt-pt', 'qu', 'quc', 'qug', 'rgn', 'rif', 'rm', 'rmf', 'rmy', 'rn', 'ro', 'roa-rup', 'roa-tara', 'ru', 'rue', 'rup', 'ruq', 'ruq-cyrl', 'ruq-latn', 'rw', 'rwr', 'sa', 'sah', 'sat', 'sc', 'scd', 'scn', 'sco', 'sdc', 'se', 'sei', 'ses', 'sg', 'sgs', 'sh', 'sh-cyrl', 'sh-latn', 'shi', 'shi-latn', 'shi-tfng', 'shn', 'shy-latn', 'si', 'simple', 'sjd', 'sje', 'sju', 'sk', 'sl', 'sli', 'sm', 'sma', 'smj', 'smn', 'sms', 'sn', 'so', 'sq', 'sr', 'sr-cyrl', 'sr-ec', 'sr-el', 'sr-latn', 'srn', 'srq', 'ss', 'st', 'stq', 'sty', 'su', 'sv', 'sw', 'szl', 'szy', 'ta', 'tay', 'tcy', 'te', 'tet', 'tg', 'tg-cyrl', 'tg-latn', 'th', 'ti', 'tk', 'tl', 'tly', 'tn', 'to', 'tokipona', 'tpi', 'tr', 'tru', 'trv', 'ts', 'tt', 'tt-cyrl', 'tt-latn', 'tum', 'tw', 'ty', 'tyv', 'tzl', 'tzm', 'udm', 'ug-latn', 'uk', 'uz', 'uz-cyrl', 'uz-latn', 've', 'vec', 'vep', 'vi', 'vls', 'vmf', 'vo', 'vot', 'vro', 'wa', 'war', 'wo', 'wuu', 'xal', 'xh', 'xmf', 'xsy', 'yo', 'yue', 'za', 'zea', 'zgh', 'zh', 'zh-classical', 'zh-cn', 'zh-hans', 'zh-hant', 'zh-hk', 'zh-min-nan', 'zh-mo', 'zh-my', 'zh-sg', 'zh-tw', 'zh-wuu', 'zh-yue', 'zu' }
-- Build the inverted map of languages to direction returned by this data module (fast, but collisions are not checked: run the test module) for _, lang in ipairs(rtlLangs) do p[lang] = true end for _, lang in ipairs(ltrLangs) do p[lang] = false end
-- Also store the two lists (at boolean indice), used by the test module to check the inverted map p[true] = rtlLangs p[false] = ltrLangs
return p</text>
<sha1>cxld5o18iaxkhru8z4aje5lec04qed1</sha1>
</revision>
</page>
<page>
<title>Template:SPARQLText</title>
<ns>10</ns>
<id>23033014</id>
<revision>
<id>1399250943</id>
<parentid>1399250772</parentid>
<timestamp>2021-04-10T14:44:00Z</timestamp>
<contributor>
<ip>87.126.92.234</ip>
</contributor>
<comment>Undid revision 1399250772 by 87.126.92.234 (talk)</comment>
<origin>1399250943</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="340" sha1="f35rnwtdn4sdogbp73jb3irfk0cvqp7" xml:space="preserve">{{#if:|
Template:IfTemplate:IfTemplate:IfTemplate:If }}...<noinclude>Template:Doc</noinclude></text>
<sha1>f35rnwtdn4sdogbp73jb3irfk0cvqp7</sha1>
</revision>
</page>
<page>
<title>Template:Int try it</title>
<ns>10</ns>
<id>109708780</id>
<redirect title="Template:Int run it" />
<revision>
<id>1764769125</id>
<timestamp>2022-11-04T21:44:15Z</timestamp>
<contributor>
<username>عُثمان</username>
<id>5050751</id>
</contributor>
<comment>عُثمان moved page Template:Int try it to Template:Int run it: the recent change to run it seems fine, but I was confused about where to find the template since the name did not match - move is inaccordance; redirects should resolve</comment>
<origin>1764769125</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="33" sha1="jwzw36nb8jui2zuk88ncwnse88o65qy" xml:space="preserve">#REDIRECT Template:Int run it</text>
<sha1>jwzw36nb8jui2zuk88ncwnse88o65qy</sha1>
</revision>
</page>
<page>
<title>Module:SPARQLMentions</title>
<ns>828</ns>
<id>28161729</id>
<revision>
<id>1453690994</id>
<parentid>661638891</parentid>
<timestamp>2021-07-04T13:54:47Z</timestamp>
<contributor>
<username>Azertus</username>
<id>1229135</id>
</contributor>
<comment>add getTitle</comment>
<origin>1453690994</origin>
<model>Scribunto</model>
<format>text/plain</format>
<text bytes="2760" sha1="lahzcbsmcekjpuk5o23yy8vvav8qfnz" xml:space="preserve">local p = {}
-- Return the label of a given data item, formatted for linking local function getLabel(frame, id, prefix) if prefix == nil then prefix = end if id == "defaultView:BubbleChart" then id = "Q24515280" end if id == "defaultView:Graph" then id = "Q24515287" end if id == "defaultView:Map" then id = "Q24515275" end
if id == "defaultView:ImageGrid" then id = "Q24515278" end
if id == "wikibase:box" then id = "Q26211169" end if id == "wikibase:cornerWest" then id = "Q26211177" end label = mw.wikibase.label( id ) if label == nil then linktext = id extra = else linktext = label .. " (" .. id .. ")" extra = ' ' .. frame:expandTemplate({ title="Reasonator", args= { [1] = id}}) .. ' ' .. frame:expandTemplate({ title="SQID", args= { [1] = id}}) end
link = mw.wikibase.getEntityUrl( id )
return '[' .. link .. ' ' .. linktext .. ']' .. extra; end
local function map(func, array)
local new_array = {}
for i,v in ipairs(array) do
new_array[i] = func(v)
end
return new_array
end
local function getAll(text, regexp, seen, items) if items == nil then items = {} end if seen == nil then seen = {} end for item in string.gmatch(text, regexp) do if seen[item] == nil then seen[item] = 1 table.insert(items, item) end end return items end
-- Produce list of items mentioned in the query
function p.getItems(frame)
if not mw.wikibase then
return "no mw.wikibase"
end
items = getAll(frame.args[1], 'wd:(Q%d+)') return table.concat(map(function(it) return getLabel(frame, it) end, items), ", ") end
-- Produce list of properties mentioned in the query function p.getProperties(frame) if not mw.wikibase then return "no mw.wikibase" end
seen = {} items = {} prefixes = {'wdt', 'p', 'ps', 'pr', 'pq', 'psv', 'pv', 'prv', 'pqv', 'wdtn', 'psn', 'pqn', 'prn', 'wdno' } for _, pr in ipairs(prefixes) do items = getAll(frame.args[1], pr .. ':(P%d+)', seen, items) end return table.concat(map(function(it) return getLabel(frame, it, 'Property:') end, items), ", ") end
function p.getFunctions(frame) if not mw.wikibase then return "no mw.wikibase" end
seen = {} items = {} func = {'defaultView:BubbleChart', 'defaultView:Graph', 'defaultView:Map', 'defaultView:ImageGrid', 'wikibase:box', "wikibase:cornerWest" } for _, pr in ipairs(func) do items = getAll(frame.args[1], pr, seen, items) end return table.concat(map(function(it) return getLabel(frame, it) end, items), ", ") end
function p.getTitle(frame) if not mw.wikibase then return "no mw.wikibase" end
for line in string.gmatch(frame.args[1], "[^%c]+%c?") do local title = string.match(line, '^#title:%s*([^%c]+)')
if not (title == nil) then return title end end end
return p</text>
<sha1>lahzcbsmcekjpuk5o23yy8vvav8qfnz</sha1>
</revision>
</page>
<page>
<title>Template:SQID</title>
<ns>10</ns>
<id>26259378</id>
<revision>
<id>1233859301</id>
<parentid>1227690908</parentid>
<timestamp>2020-07-18T14:13:28Z</timestamp>
<contributor>
<username>MisterSynergy</username>
<id>44949</id>
</contributor>
<comment>move URL to https://sqid.toolforge.org</comment>
<origin>1233859301</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="993" sha1="j6wq5aq6l7wsi92xtysclan6m8dprov" xml:space="preserve"><!--
-->{{#if: | Template:Q  }}<!-- -->{{#if: | Template:P  }}<!-- -->{{#if: | <span class="plainlinks">[https://sqid.toolforge.org/#{{#if:
| /view?id={{#if:
|
| {{#if:
| Q{{#titleparts:}}
| P{{#titleparts:}}
}}
}}&lang=⧼Lang⧽
| /?lang=⧼Lang⧽
}} ]</span>
}}<!-- --><nowiki/>?lang=⧼Lang⧽ }}<!-- --><noinclude>Template:Documentation</noinclude></text>
<sha1>j6wq5aq6l7wsi92xtysclan6m8dprov</sha1>
</revision>
</page>
<page>
<title>Template:Reasonator</title>
<ns>10</ns>
<id>17365939</id>
<revision>
<id>1556587517</id>
<parentid>1507464031</parentid>
<timestamp>2022-01-05T12:35:07Z</timestamp>
<contributor>
<username>Venca24</username>
<id>103280</id>
</contributor>
<comment>+ cs, eo</comment>
<origin>1556587517</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="882" sha1="ej9pd5v5fuipsemxo8gx8dbsqgg5vij" xml:space="preserve">{{#if:
| <span class="plainlinks">[8]</span> }} Template:TranslateThis<noinclude>Template:Documentation</noinclude></text>
<sha1>ej9pd5v5fuipsemxo8gx8dbsqgg5vij</sha1>
</revision>
</page>
<page>
<title>Template:WikiProject</title>
<ns>10</ns>
<id>21790485</id>
<revision>
<id>2298079997</id>
<parentid>2053606357</parentid>
<timestamp>2025-01-14T09:49:46Z</timestamp>
<contributor>
<username>Mormegil</username>
<id>28758</id>
</contributor>
<comment>+cs</comment>
<origin>2298079997</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="2446" sha1="afrxihplnkiijrydcgi7kwzg00a84sv" xml:space="preserve"><noinclude>Template:Doc</noinclude><!--
-->{{#ifexist: Wikidata:WikiProject <!--
#then:
-->|{{#if:<!--
#then:
-->|Template:Section link<!--
#else:
-->|Template:Ll<!--
-->}}<!--
#else:
-->|{{error<!--
-->|Template:TranslateThis<!--
-->}}<!--
--> <small>Template:TranslateThis<!--
--></small><!--
-->}}</text>
<sha1>afrxihplnkiijrydcgi7kwzg00a84sv</sha1>
</revision>
</page>
<page>
<title>Template:WikiProject/pagename</title>
<ns>10</ns>
<id>22491841</id>
<revision>
<id>1294585707</id>
<parentid>238479307</parentid>
<timestamp>2020-10-19T21:05:53Z</timestamp>
<contributor>
<username>Tacsipacsi</username>
<id>33956</id>
</contributor>
<comment>substitute template that doesn’t do what its name suggests and what it does in other projects</comment>
<origin>1294585707</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="60" sha1="8o2k69wu2sme8f490aakwi7ynj63jjv" xml:space="preserve">{{#if:|Wikidata Talk|Wikidata}}:WikiProject {{{1}}}</text>
<sha1>8o2k69wu2sme8f490aakwi7ynj63jjv</sha1>
</revision>
</page>
<page>
<title>Template:ItemOrNot</title>
<ns>10</ns>
<id>28161695</id>
<revision>
<id>361346548</id>
<parentid>361300782</parentid>
<timestamp>2016-08-02T21:22:10Z</timestamp>
<contributor>
<username>Smalyshev (WMF)</username>
<id>1482806</id>
</contributor>
<origin>361346548</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="384" sha1="230nkvb4w9pmw09vu3optxajqkjdr42" xml:space="preserve">{{#if: | * {{{1}}}: | }}<noinclude>
<templatedata> { "params": { "1": { "label": "List item name", "type": "string", "required": true }, "2": { "description": "List item contents", "type": "string" } }, "description": "Displays list item if second argument is not empty, otherwise nothing", "format": "block" } </templatedata> </noinclude></text>
<sha1>230nkvb4w9pmw09vu3optxajqkjdr42</sha1>
</revision>
</page>
<page>
<title>Template:Int Properties</title>
<ns>10</ns>
<id>25945270</id>
<revision>
<id>360948553</id>
<parentid>360948486</parentid>
<timestamp>2016-07-31T15:39:37Z</timestamp>
<contributor>
<username>Airon90</username>
<id>4782</id>
</contributor>
<origin>360948553</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="63" sha1="1f6bvc59pk8lngjngkff5ej07hrd17a" xml:space="preserve"><noinclude>Template:Doc</noinclude>Template:Capitalize</text>
<sha1>1f6bvc59pk8lngjngkff5ej07hrd17a</sha1>
</revision>
</page>
<page>
<title>Template:Int properties</title>
<ns>10</ns>
<id>25941214</id>
<revision>
<id>2504115378</id>
<parentid>2438818739</parentid>
<timestamp>2026-06-10T11:28:12Z</timestamp>
<contributor>
<username>مواطن تونسي</username>
<id>1537128</id>
</contributor>
<minor/>
<comment>traduction ar</comment>
<origin>2504115378</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="746" sha1="ao6colplfei84pspf07jmngpp7arssr" xml:space="preserve"><noinclude>Template:Doc</noinclude>Template:TranslateThis</text>
<sha1>ao6colplfei84pspf07jmngpp7arssr</sha1>
</revision>
</page>
<page>
<title>Template:SPARQL2/doc</title>
<ns>10</ns>
<id>35750675</id>
<revision>
<id>1425856775</id>
<parentid>1425856600</parentid>
<timestamp>2021-05-21T17:39:04Z</timestamp>
<contributor>
<username>PAC2</username>
<id>4892</id>
</contributor>
<comment>/* See also */ typo</comment>
<origin>1425856775</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="533" sha1="p2irk8qhdq7sqdc2n9kyjs3lvi2j5kw" xml:space="preserve"><nowiki>Template loop detected: Template:SPARQL2</nowiki>
Template loop detected: Template:SPARQL2
<nowiki>Template loop detected: Template:SPARQL2</nowiki>
Template loop detected: Template:SPARQL2
<nowiki>Template loop detected: Template:SPARQL2</nowiki>
Template loop detected: Template:SPARQL2
<nowiki>Template loop detected: Template:SPARQL2</nowiki>
Template loop detected: Template:SPARQL2
See also
<sha1>p2irk8qhdq7sqdc2n9kyjs3lvi2j5kw</sha1>
</revision>
</page>
<page>
<title>Template:Int run it</title>
<ns>10</ns>
<id>25022557</id>
<revision>
<id>2438820809</id>
<parentid>2033139854</parentid>
<timestamp>2025-12-06T14:46:20Z</timestamp>
<contributor>
<username>YeBoy371</username>
<id>2200680</id>
</contributor>
<origin>2438820809</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="1085" sha1="8ggotttekjqxrksv8jgpqj8yv3lzvla" xml:space="preserve"><noinclude>Template:Doc</noinclude>Template:TranslateThis</text>
<sha1>8ggotttekjqxrksv8jgpqj8yv3lzvla</sha1>
</revision>
</page>
</mediawiki></nowiki>
<mediawiki xmlns="http://www.mediawiki.org/xml/export-0.11/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.11/ http://www.mediawiki.org/xml/export-0.11.xsd" version="0.11" xml:lang="en">
<siteinfo> <sitename>Wikidata</sitename> <dbname>wikidatawiki</dbname> <base>https://www.wikidata.org/wiki/Wikidata:Main_Page</base> <generator>MediaWiki 1.47.0-wmf.17</generator> <case>first-letter</case> <namespaces> <namespace key="-2" case="first-letter">Media</namespace> <namespace key="-1" case="first-letter">Special</namespace> <namespace key="0" case="first-letter" /> <namespace key="1" case="first-letter">Talk</namespace> <namespace key="2" case="first-letter">User</namespace> <namespace key="3" case="first-letter">User talk</namespace> <namespace key="4" case="first-letter">Wikidata</namespace> <namespace key="5" case="first-letter">Wikidata talk</namespace> <namespace key="6" case="first-letter">File</namespace> <namespace key="7" case="first-letter">File talk</namespace> <namespace key="8" case="first-letter">MediaWiki</namespace> <namespace key="9" case="first-letter">MediaWiki talk</namespace> <namespace key="10" case="first-letter">Template</namespace> <namespace key="11" case="first-letter">Template talk</namespace> <namespace key="12" case="first-letter">Help</namespace> <namespace key="13" case="first-letter">Help talk</namespace> <namespace key="14" case="first-letter">Category</namespace> <namespace key="15" case="first-letter">Category talk</namespace> <namespace key="120" case="first-letter">Property</namespace> <namespace key="121" case="first-letter">Property talk</namespace> <namespace key="122" case="first-letter">Query</namespace> <namespace key="123" case="first-letter">Query talk</namespace> <namespace key="146" case="first-letter">Lexeme</namespace> <namespace key="147" case="first-letter">Lexeme talk</namespace> <namespace key="640" case="first-letter">EntitySchema</namespace> <namespace key="641" case="first-letter">EntitySchema talk</namespace> <namespace key="710" case="first-letter">TimedText</namespace> <namespace key="711" case="first-letter">TimedText talk</namespace> <namespace key="828" case="first-letter">Module</namespace> <namespace key="829" case="first-letter">Module talk</namespace> <namespace key="1198" case="first-letter">Translations</namespace> <namespace key="1199" case="first-letter">Translations talk</namespace> <namespace key="1728" case="first-letter">Event</namespace> <namespace key="1729" case="first-letter">Event talk</namespace> <namespace key="2600" case="first-letter">Topic</namespace> </namespaces> </siteinfo> <page> <title>Template:SPARQL2</title> <ns>10</ns> <id>28161690</id> <revision> <id>2346047691</id> <parentid>2346040648</parentid> <timestamp>2025-05-08T12:02:25Z</timestamp> <contributor> <username>Madamebiblio</username> <id>2952832</id> </contributor> <minor/> <comment>Reverted edits by 201.143.205.181 (talk) to last revision by Kokage si</comment> <origin>2294596805</origin> <model>wikitext</model> <format>text/x-wiki</format> <text bytes="7567" sha1="s4975lvx7s2i4pjji1govtxccu2rt3e" xml:space="preserve">Template:SPARQL2/doc
<onlyinclude>Template:Clear{{#ifeq:|{{{nohints}}}| <!--hidden hints--> | {{TranslateThis<!--
-->|ar=يستخدم الاستعلام التالي هذه:<!--
-->|be-tarask=Дадзены запыт выкарыстоўвае:<!--
-->|cs=Následující dotaz používá:<!--
-->|de=Die Suchanfrage verwendet:<!--
-->|en=The following query uses these:<!--
-->|en-gb=The following query uses these:<!--
-->|el=Το ακόλουθο ερώτημα χρησιμοποιεί αυτά:<!--
-->|es=La siguiente consulta utiliza lo siguiente:<!--
-->|fi=Seuraava kysely käyttää näitä:<!--
-->|fr=La requête suivante utilise ces :<!--
-->|hu=Ez a lekérdezés a következőket használja:<!--
-->|id=Kueri di bawah akan menggunakan entitas berikut:<!--
-->|it=La seguente query utilizza questi:<!--
-->|ja=以下のクエリではこれらを使用します:<!--
-->|nl=Deze query gebruikt:<!--
-->|pl=To zapytanie używa:<!--
-->|pt=A consulta seguinte utiliza estes:<!--
-->|pt-br=A consulta seguinte utiliza estes:<!--
-->|ru=Этот запрос использует:<!--
-->|sv=Följande fråga använder dessa:<!--
-->|tr=Aşağıdaki sorgu bunları kullanıyor:<!--
-->|uk=Цей запит використовує:<!--
-->}}<!-- -->Template:ItemOrNot <!-- -->Template:ItemOrNot <!-- -->Template:ItemOrNot <!--
-->}}
[[:Template:SPARQLText]]
<!-- --><div class="displayonly">{{#if: ||Template:Int try it}}</div>Template:Clear</onlyinclude><noinclude> <templatedata> { "params": { "query": { "required": true, "label": { "ar": "استعلام", "be-tarask": "запыт", "cs": "dotaz", "en": "query", "es": "consulta", "fr": "requête", "id": "kueri", "it": "query", "ja": "クエリ", "pl": "zapytanie", "pt": "consulta", "pt-br": "consulta", "sv": "fråga",
"tr": "sorgu",
"uk": "запит" }, "description": { "ar": "استعلام سباركل", "be-tarask": "запыт SPARQL", "cs": "SPARQL dotaz", "en": "SPARQL query", "es": "consulta SPARQL", "fr": "la requête que le modèle doit traiter et afficher", "id": "kueri SPARQL", "it": "query SPARQL", "ja": "SPARQLクエリ", "pl": "query SPARQL", "pt": "consulta SPARQL", "pt-br": "consulta SPARQL", "sv": "SPARQL fråga", "tr": "SPARQL sorgusu", "uk": "запит SPARQL" }, "example": { "be-tarask": "SELECT * WHERE { ?x wdt:P31 wd:Q5 } LIMIT 1", "cs": "SELECT * WHERE { ?x wdt:P31 wd:Q5 } LIMIT 1", "en": "SELECT * WHERE { ?x wdt:P31 wd:Q5 } LIMIT 1", "es": "SELECT ?item WHERE { ?item wdt:P31 wd:Q5 } LIMIT 1", "fr": "select ?item where { ?item wdt:P31 wd:Q5 } LIMIT 1", "id": "SELECT * WHERE { ?a wdt:P31 wd:Q5 } LIMIT 1", "it": "select ?item where { ?item wdt:P31 wd:Q5 } LIMIT 1", "pt": "select ?item where { ?item wdt:P31 wd:Q5 } LIMIT 1", "pt-br": "select ?item where { ?item wdt:P31 wd:Q5 } LIMIT 1" }, "type": "string", "aliases": [ "sparql" ], "suggested": true }, "extraprefix": { "description": { "ar": "بادئات إضافية لإضافتها",
"be-tarask": "дадатковыя прэфіксы (неабавязковыя)",
"cs": "Dodatečné prefixy (volitelné)", "en": "Extra prefixes to be added", "es": "Prefijos extra a añadir (opcional)", "fr": "les préfixes SPARQL non standards ou inconnus du service de requête éventuellement nécessaires (optionnel)", "id": "Prefiks SPARQL yang akan ditambahkan", "it": "Aggiungere i prefissi SPARQL non standard o sconosciuti eventualmente necessari (opzionale)", "ja": "追加する接頭辞(オプション)", "pl": "Dodatkowe prefiksy (opcjonalnie)", "pt": "Adicionar os prefixos SPARQL não padrões ou desconhecidos eventualmente necessários (opcional)", "pt-br": "Adicionar os prefixos SPARQL não padrões ou desconhecidos eventualmente necessários (opcional)", "uk": "Додаткові префікси (необов'язкові)" }, "example": "PREFIX wikibase: <http://wikiba.se/ontology#>", "type": "string" } }, "description": {
"be-tarask": "Гэты шаблён выводзіць запыт SPARQL з падсьветкай сынтаксісу, выкарыстаных элемэнтаў і спасылак на WDQS дзеля запуску запыту. \nЗРАБІЦЬ: скарыстаныя меткі элемэнтаў не лякалізаваныя",
"cs": "Tato šablona zobrazuje SPARQL dotaz ze zvýrazněnou syntaxí, použité položky a odkaz na WDQS dotazovací službu pro vyzkoušení.", "en": "This template displays SPARQL query with syntax highlighting, used items and link to WDQS query site to run the query. \nTODO: used items labels are not localized", "es": "Esta plantilla muestra una consulta SPARQL con resaltado de sintaxis, los items utilizados y un enlace al WDQS para lanzar la consulta", "fr": "Ce modèle affiche une requête SPARQL et permet de la lancer au travers du service de requête Wikidata. Il affiche aussi quelques informations basiques sur les éléments et fonctionnalités utilisées par cette requête", "id": "Templat ini menampilkan kueri SPARQL dengan pembedaan warna pada sintaks beserta entitas Wikidata yang digunakan dan pranala kueri di WDQS.", "it": "Questo template mostra una query SPARQL evidenziandone la sintassi e gli elementi usati e fornisce un link alla query WDQS site che permette di lanciare la query", "ja": "このテンプレートは構文強調付きのSPARQLクエリ、使用した項目、クエリを実行するWDQSクエリサイトへのリンクを表示します。", "pl": "Szablon wyświetla zapytanie SPARQL z podświetlaniem składni, listą użytych elementów i linkiem do WDQS.", "pt": "Esta predefinição mostra uma consulta SPARQL na qual evidencia a sintaxe e os elementos usados e fornece um enlace ao site WDQS que permite executar a consulta", "pt-br": "Esta predefinição mostra uma consulta SPARQL na qual evidencia a sintaxe e os elementos usados e fornece um enlace ao site WDQS que permite executar a consulta", "sv": "Denna mall visar en SPARQL fråga med syntaxfärgning, använda objekt och länk till WDQS frågesajten för att köra frågan. \nTODO: använda objekts etiketter är inte lokaliserade", "uk": "Цей шаблон показує запит SPARQL з підсвічуванням елементів синтаксису, список використаних елементів і посилання на сайт WDQS-запиту." }, "paramOrder": [ "query", "extraprefix" ], "format": "block" } </templatedata> </noinclude></text>
<sha1>s4975lvx7s2i4pjji1govtxccu2rt3e</sha1>
</revision>
</page>
<page>
<title>Template:Template</title>
<ns>10</ns>
<id>12414</id>
<redirect title="Template:Tl" />
<revision>
<id>431881</id>
<parentid>312894</parentid>
<timestamp>2012-11-13T02:07:50Z</timestamp>
<contributor>
<username>~riley</username>
<id>2219</id>
</contributor>
<comment>http://en.wikipedia.org/w/index.php?title=Template:Template&action=edit</comment>
<origin>431881</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="25" sha1="cdpzj9yp99pn5v093b404f4sc7cybv1" xml:space="preserve">#REDIRECT Template:Tl</text>
<sha1>cdpzj9yp99pn5v093b404f4sc7cybv1</sha1>
</revision>
</page>
<page>
<title>Template:Tl</title>
<ns>10</ns>
<id>3170</id>
<revision>
<id>2508986920</id>
<parentid>1946850712</parentid>
<timestamp>2026-06-22T01:25:21Z</timestamp>
<contributor>
<username>RogueScholar</username>
<id>3003918</id>
</contributor>
<minor/>
<comment>Format template code for readability and convert numeric HTML entities to named equivalents to accomplish the same</comment>
<origin>2508986920</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="1299" sha1="dqel96mgakegupz568kpnt91rdib9m4" xml:space="preserve"><includeonly><code>{{{{#if:|subst:}}<!-- Begin evaluation of first parameter.
-->{{#ifeq:{|:|:[[]]|<!-- If already prefixed by colon, show the link as such, too.
-->{{#switch:<!-- Target's namespace determines the link format. -->
| | Template = [[Template:|]]<!-- Main: (absent) or Template: namespaces -->
| File | Category = [[:{{{1}}}]]<!-- File and Category namespaces receive hidden colon prefix. -->
| #default = [[{{{1}}}]]<!-- All others are linked verbatim.
-->}}<!-- End of switch function. -->}}<!-- End of first parameter evaluation.
-->{{#ifeq: {{{2}}}| x||{{{2}}}}}<!--
-->{{#ifeq: {{{3}}}| x||{{{3}}}}}<!--
-->{{#ifeq: {{{4}}}| x||{{{4}}}}}<!--
-->{{#ifeq: {{{5}}}| x||{{{5}}}}}<!--
-->{{#ifeq: {{{6}}}| x||{{{6}}}}}<!--
-->{{#ifeq: {{{7}}}| x||{{{7}}}}}<!--
-->{{#ifeq: {{{8}}}| x||{{{8}}}}}<!--
-->{{#ifeq: {{{9}}}| x||{{{9}}}}}<!--
-->{{#ifeq:{{{10}}}|x||{{{10}}}}}}}</code></includeonly><noinclude>
Template:Documentation</noinclude></text>
<sha1>dqel96mgakegupz568kpnt91rdib9m4</sha1>
</revision>
</page>
<page>
<title>Template:Capitalize</title>
<ns>10</ns>
<id>24835143</id>
<revision>
<id>2283223741</id>
<parentid>2282968755</parentid>
<timestamp>2024-12-03T22:55:49Z</timestamp>
<contributor>
<username>Tacsipacsi</username>
<id>33956</id>
</contributor>
<comment>Undid revision 2282968755 by 2806:2F0:A080:F124:78E9:9300:6983:EA83 (talk): ???</comment>
<origin>2283223741</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="100" sha1="08bgnnmlolmwjwag381zkq615fl2s0a" xml:space="preserve"><includeonly>Script error: No such module "Capitalize".</includeonly><noinclude>
Template:Doc </noinclude></text>
<sha1>08bgnnmlolmwjwag381zkq615fl2s0a</sha1>
</revision>
</page>
<page>
<title>Template:Int items</title>
<ns>10</ns>
<id>28641837</id>
<revision>
<id>2438810545</id>
<parentid>2208740771</parentid>
<timestamp>2025-12-06T14:15:50Z</timestamp>
<contributor>
<username>YeBoy371</username>
<id>2200680</id>
</contributor>
<origin>2438810545</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="475" sha1="knyh87z85w0os01yxpmvrzvlnwf07fb" xml:space="preserve"><noinclude>Template:Doc</noinclude>Template:TranslateThis</text>
<sha1>knyh87z85w0os01yxpmvrzvlnwf07fb</sha1>
</revision>
</page>
<page>
<title>Module:Capitalize</title>
<ns>828</ns>
<id>25940912</id>
<revision>
<id>333880118</id>
<parentid>327538585</parentid>
<timestamp>2016-05-08T21:08:10Z</timestamp>
<contributor>
<username>TomT0m</username>
<id>7333</id>
</contributor>
<comment>cap after the tags</comment>
<origin>333880118</origin>
<model>Scribunto</model>
<format>text/plain</format>
<text bytes="518" sha1="oi3oo9q42s5okxrm5hbfy01zk32pehp" xml:space="preserve">
local p = {}
function p.cap(str) lang = mw.getContentLanguage() if lang:ucfirst(str) ~= str then return lang:ucfirst(str) else local substr = mw.ustring.sub b, e = mw.ustring.find(str, ">%s*%a") while e ~= nil do if mw.ustring.find(">", substr(str, b,e)) == nil then return substr(str, 1, e-1) .. lang:ucfirst(substr(str,e,e)) ..substr(str, e+1) end b, e = mw.ustring.find(str, ">%s*%a", e) end return str end end
function p.capitalize(frame) return p.cap(frame.args[1]) end
return p</text>
<sha1>oi3oo9q42s5okxrm5hbfy01zk32pehp</sha1>
</revision>
</page>
<page>
<title>Template:Clear</title>
<ns>10</ns>
<id>12131100</id>
<revision>
<id>665474881</id>
<parentid>91992232</parentid>
<timestamp>2018-04-14T18:59:12Z</timestamp>
<contributor>
<username>Dataeast0000001</username>
<id>2952466</id>
</contributor>
<comment>move onlyinclude to noinclude</comment>
<origin>665474881</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="79" sha1="5aa2j06l3n3husy1g6jggf6oznzocau" xml:space="preserve"><div style="clear:both;"></div><noinclude>Template:Documentation</noinclude></text>
<sha1>5aa2j06l3n3husy1g6jggf6oznzocau</sha1>
</revision>
</page>
<page>
<title>Module:Fallback</title>
<ns>828</ns>
<id>19181086</id>
<revision>
<id>714642825</id>
<parentid>714642495</parentid>
<timestamp>2018-07-23T16:35:03Z</timestamp>
<contributor>
<username>Matěj Suchánek</username>
<id>53613</id>
</contributor>
<minor/>
<comment>fix</comment>
<origin>714642825</origin>
<model>Scribunto</model>
<format>text/plain</format>
<text bytes="5559" sha1="6vr2in87podxnsj3x2jttt1r1qisf9q" xml:space="preserve">local p = {}
function p.fblist(lang, langonly) -- list the full fallback chain from a language to en local fbtable = mw.language.getFallbacksFor(lang) table.insert(fbtable, 1, lang) if not langonly then table.insert(fbtable, 'message') table.insert(fbtable, 'item') table.insert(fbtable, 'default') end return fbtable end
function p._langSwitch(args, lang) -- args: table of translations -- Return error if there is not default and no English version -- otherwise returns the message in the most appropriate, plus the lang code as a second value if not args.en and not args.default and not args.message and not args.item and args.nocat ~= '1' then return error("langSwitch error: no default") end -- get language (either stated one or user's default language) if not lang then return '<strong class="error">LangSwitch Error: no lang</strong>' -- must become proper error end -- get the list of acceptable language (lang + those in lang's fallback chain) and check their content for i, j in ipairs(p.fblist(lang)) do if args[j] then if args[j] == '~' then return nil, j end if j == 'item' then local label, lang = mw.wikibase.getLabelWithLang(args[j]) if label then return label, lang else return args[j], 'en' end end if j == 'message' then return tostring(mw.message.new(args[j]):inLanguage(lang)) end -- if this is an interface message if args[j] ~= then return args[j], j end end end return nil end
function p.langSwitch(frame) -- version to be used from wikitext local args = frame.args -- if no expected args provided than check parent template/module args if not args.en and not args.default and not args.nocat then args = frame:getParent().args end local lang if args.lang and args.lang ~= then lang = args.lang args.lang = nil else -- get user's chosen language lang = frame:preprocess( "⧼lang⧽" ) end local str, language = p._langSwitch(args, lang) return str -- get the first value of the langSwitch, (the text) not the second (the language) end
function p.fallbackpage(base, lang, formatting) local languages = p.fblist(lang) for i, lng in ipairs(languages) do if mw.title.new(base .. '/' .. lng).exists then if formatting == 'table' then return {base .. '/' .. lng, lng} -- returns name of the page + name of the language else return base .. '/' .. lng -- returns only the page end end end return base end
function p.autotranslate(frame) -- logic for template:Autotranslate local args = frame.args if not args.lang or args.lang == then args.lang = frame:preprocess( "⧼lang⧽" ) -- get user's chosen language end
-- find base page local base = args.base if not base or base == then return '<strong class="error">Base page not provided for autotranslate</strong>' end if string.sub(base, 2, 9) ~= 'emplate:' then base = 'Template:' .. base -- base provided without 'Template:' part end
-- find base template language subpage local page = p.fallbackpage(base, args.lang) -- if (not page and base ~= args.base) then -- try the original args.base string. This case is only needed if base is not in template namespace page = p.fallbackpage(args.base, args.lang) end if not page then return string.format('<strong class="error">no fallback page found for autotranslate (base=%s, lang=%s)</strong>', args.base, args.lang) end
-- repack args in a standard table local newargs = {} for field, value in pairs(args) do if field ~= 'base' then newargs[field] = value end end
-- Transclude Template:Page with template arguments the same as the ones passed to Template:Autotranslate template. return frame:expandTemplate{ title = page, args = newargs } end
function p.translate(page, key, lang) --translate data stored in a module if type(page) == 'string' then -- if the requested translation table is not yet loaded page = require('Module:' .. page) end
local val if page[key] then val = page[key] elseif page.keys and page.keys[key] then-- key 'keys" is an index of all keys, including redirects, see Module:i18n/datatype val = page.keys[key] end if not val then return '<' .. key .. '>' end return p._langSwitch(val, lang) end
function p.translatelua(frame) local lang = frame.args.lang local page = require('Module:' .. mw.text.trim(frame.args[1])) -- page should only contain a simple of translations if not lang or mw.text.trim(lang) == then lang = frame:preprocess( "⧼lang⧽" ) end if frame.args[2] then page = page[mw.text.trim(frame.args[2])] end return p._langSwitch(page, lang) end
function p.runTests() local toFallbackTest = require('Module:Fallback/tests/fallbacks') local result = true
mw.log('Testing fallback chains') for i, t in ipairs(toFallbackTest) do local fbtbl = table.concat(p.fblist(t.initial), ', ') local expected = table.concat(t.expected, ', ') local ret = (fbtbl == expected) mw.log(i, ret and 'passed' or 'FAILED', t.initial, (not ret) and ('FAILED\nis >>' .. fbtbl .. '<<\nbut should be >>' .. expected .. '<<\n') or ) result = result and ret end
return result end
function p.showTemplateArguments(frame) -- list all input arguments of the template that calls "Script error: No such module "Fallback"." local str = for name, value in pairs( frame:getParent().args ) do if str == then str = string.format('%s=%s', name, value) -- argument #1 else str = string.format('%s, %s=%s', str, name, value) -- the rest end end return str end
return p</text>
<sha1>6vr2in87podxnsj3x2jttt1r1qisf9q</sha1>
</revision>
</page>
<page>
<title>Template:Ll</title>
<ns>10</ns>
<id>3264473</id>
<revision>
<id>618665821</id>
<parentid>443393354</parentid>
<timestamp>2018-01-11T02:59:59Z</timestamp>
<contributor>
<username>Jarekt</username>
<id>1274</id>
</contributor>
<comment>Fulfilling edit request by User:Kaganer. Thanks for helping!</comment>
<origin>618665821</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="178" sha1="h8s4unutwk14jcbyfcq88r5yvqbu5x5" xml:space="preserve">[[Special:MyLanguage/{{{1}}}{{#if:|#{{{anchor}}}}}|Template:PDT</includeonly>]]<noinclude>
Template:Documentation </noinclude></text>
<sha1>h8s4unutwk14jcbyfcq88r5yvqbu5x5</sha1>
</revision>
</page>
<page>
<title>Template:TranslateThis</title>
<ns>10</ns>
<id>16552759</id>
<revision>
<id>483148362</id>
<parentid>483129342</parentid>
<timestamp>2017-05-08T01:54:31Z</timestamp>
<contributor>
<username>MKar</username>
<id>6110</id>
</contributor>
<minor/>
<comment>Undid revision 483129342 by 70.71.90.6 (talk)</comment>
<origin>483148362</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="97" sha1="rm4lztokzfib496c8sbt9q36vx6n9tz" xml:space="preserve"><includeonly>Script error: No such module "TranslateThis".</includeonly><noinclude>Template:Documentation</noinclude></text>
<sha1>rm4lztokzfib496c8sbt9q36vx6n9tz</sha1>
</revision>
</page>
<page>
<title>Module:TranslateThis</title>
<ns>828</ns>
<id>16552706</id>
<revision>
<id>2144500220</id>
<parentid>1980692436</parentid>
<timestamp>2024-05-04T13:29:50Z</timestamp>
<contributor>
<username>Uzume</username>
<id>11596</id>
</contributor>
<comment>switch frame:preprocess("⧼lang⧽") to callParserFunction("int", "lang")</comment>
<origin>2144500220</origin>
<model>Scribunto</model>
<format>text/plain</format>
<text bytes="1738" sha1="j2it1vjxk477pw54t7yheap3g9xt452" xml:space="preserve">local fb = require('Module:Fallback')
local dir = require('Module:Dir')
return { main = function( frame )
local function shallowcopy(orig) if type(orig) ~= 'table' then return orig end
local result = {} for key, value in pairs(orig) do result[key] = value end return result end
local args = shallowcopy(frame:getParent().args) local lang = args.lang or frame:callParserFunction("int", "lang") -- I don't know of any other way to get the user's language... args.lang = nil
local anchor = args.anchor args.anchor = nil if (anchor and args[anchor]) then anchor = args[anchor] end anchor = anchor and frame:expandTemplate( { title = "Anchor", args = { anchor } } ) or
local result = args[ lang ] if result and result ~= then result = '<span dir="' .. dir.select(lang, 'rtl', 'ltr') .. '" lang="' .. lang .. '">' .. result .. '</span>' else local default = {} for i, v in pairs( args ) do if v ~= "" then table.insert(default, '<span dir="' .. dir.select(i, 'rtl', 'ltr') .. '" lang="' .. i .. '">' .. v .. '</span> <small>(' .. i .. ')</small>') end end default = table.concat(default, ' / ') args.default=default local newlang result, newlang = fb._langSwitch(args, lang) if not newlang then result = elseif newlang~='default' then result = '<span dir="' .. dir.select(newlang, 'rtl', 'ltr') .. '" lang="' .. newlang .. '">' .. result .. '</span> <small>(' .. newlang .. ')</small>' end local langname = mw.language.fetchLanguageName( lang, lang ) if langname ~= "" and newlang then result = result .. " – " .. frame:expandTemplate( { title = "Help translate", args = { langname, lang = lang } } ) end end
return anchor .. result end}</text>
<sha1>j2it1vjxk477pw54t7yheap3g9xt452</sha1>
</revision>
</page>
<page>
<title>Module:Dir</title>
<ns>828</ns>
<id>95388294</id>
<revision>
<id>1935187194</id>
<parentid>1935159027</parentid>
<timestamp>2023-07-15T22:41:28Z</timestamp>
<contributor>
<username>Tacsipacsi</username>
<id>33956</id>
</contributor>
<comment>Undid revision 1935159027 by 177.232.91.83 (talk): test edit</comment>
<origin>1935187194</origin>
<model>Scribunto</model>
<format>text/plain</format>
<text bytes="5612" sha1="n6dnippb8dl8nupbrxgqviac0hno50v" xml:space="preserve">-- This module implements Template:Dir.
-- local rtlOverrides = mw.loadData('Module:Dir/RTL overrides') -- !!! mw.loadData() is currently broken, it does NOT load anything local rtlOverrides = require('Module:Dir/RTL overrides') local p = {}
local function trim(s)
if s and s ~= then s = tostring(s):match('^%s*(.-)%s*$') end
if s == then return nil end
return s
end
function p.rtlLangs(isRTL)
if isRTL == nil then isRTL = true end
return rtlOverrides[isRTL] or {}
end
function p.isRTL(code)
if type(code) ~= 'string' then return nil end
local v = rtlOverrides[code] -- very fast and not limited in the number of supported languages
if v ~= nil then return v end -- return it if mapped, otherwise use MediaWiki library:
local success, ret = pcall(function ()
return mw.language.new(code):isRTL() -- expensive and limited to 20 languages per MediaWiki instance
end)
return success and ret
end
function p.select(code, rtl, ltr)
if p.isRTL(code) then
return rtl
else
return ltr
end
end
-- Used via a template Template:Dir -- which just calls Script error: No such module "Dir"., the 3 parameters are automatically trimmed: -- Parameter 1 takes the default value from ⧼Lang⧽ if it's empty or not specified. -- Parameter 2 can be named rtl, may be explicitly empty, otherwise takes the default value 'rtl' only if it's not specified. -- Parameter 3 can be named ltr, may be explicitly empty, otherwise takes the default value 'ltr' only if it's not specified. function p.main(frame)
local args = frame:getParent().args -- Parameters used to transclude Template:Dir
local code = trim(args[1]) or frame:callParserFunction('Int', 'Lang')
local rtl = trim(args.rtl or args[2] or 'rtl')
local ltr = trim(args.ltr or args[3] or 'ltr')
return p.select(code, rtl, ltr)
end
setmetatable(p, { quickTests = function ()
local rtlLangs = p.rtlLangs(true) local ltrLangs = p.rtlLangs(false)
-- Basic check of data format
local function checkLangs(name, langs)
for k, lang in pairs(langs) do
assert(type(k) == 'number' and k == math.floor(k)
and type(lang) == 'string' and #lang >= 2 and #lang <= 16
and lang:find('^[a-z][%-0-9a-z]*[0-9a-z]$') == 1,
": Invalid sequence of language codes, " .. name .. "['" .. k .. "'] = '" .. lang .. "'")
end
return true
end
local ok, msg
ok, msg = pcall(checkLangs, 'rtlLangs', rtlLangs)
if not ok then return false, msg end
ok, msg = pcall(checkLangs, 'ltrLangs', ltrLangs)
if not ok then return false, msg end
-- Build inverse maps of languages having each direction
local isrtl, isltr = {}, {}
for _, lang in ipairs(rtlLangs) do isrtl[lang] = true end
for _, lang in ipairs(ltrLangs) do isltr[lang] = true end
-- Check conflicts using the two inverse maps
for _, lang in ipairs(rtlLangs) do
if isltr[lang] then return false, ": Direction conflict for '" .. lang .. "'" end
end
for _, lang in ipairs(ltrLangs) do
if isrtl[lang] then return false, ": Direction conflict for '" .. lang .. "'" end
end
-- Log missing languages (allows filling the tables above) according to MediaWiki internal data
local knownLangs, isKnownLang = mw.language.fetchLanguageNames(), {}
for lang, _ in pairs(knownLangs) do
isKnownLang[lang] = true
if rtlOverrides[lang] == nil then -- only if we still don't have data for this language
-- Note: we cannot check more than 20 languages at once, then MediaWiki raises an error.
-- So this test only runs on the Lua console, where you can update the tables at top.
-- This also means we cannot compare what MediaWiki returns with the direction we map here for all languages.
ok, value = pcall(function() return tostring(mw.language.new(lang):isRTL()) end)
mw.log("Warning: missing direction for language '" .. lang .. "', MediaWiki returns '" .. value .. "'")
end
end
-- utility: reverse order iterator on sequences
local function revipairs(t)
return function(t, i)
i = i - 1
local v = t[i]
if v == nil then return nil end
return i, v
end, t, #t + 1
end
-- Sort and deduplicate language code values (by scanning backward) for data cleanup
-- Also log languages having a direction mapping in this module but still not known by MediaWiki
table.sort(rtlLangs)
table.sort(ltrLangs)
for i, lang in revipairs(rtlLangs) do
if rtlLangs[i - 1] == rtlLangs[i] then table.remove(rtlLangs, i) end
if isKnownLang[lang] == nil then
mw.log("RTL language '" .. lang .. "' still not known by Mediawiki (could be a missing alias or variant)")
end
end
for i, lang in revipairs(ltrLangs) do
if ltrLangs[i - 1] == ltrLangs[i] then table.remove(ltrLangs, i) end
if isKnownLang[lang] == nil then
mw.log("LTR language '" .. lang .. "' still not known by Mediawiki (could be a missing alias or variant)")
end
end
-- Final presentation of current lists, sorted and deduplicated
mw.log("----")
mw.log("local rtlLangs = { '" .. table.concat(rtlLangs, "', '") .. "' }")
mw.log("local ltrLangs = { '" .. table.concat(ltrLangs, "', '") .. "' }")
return true
end }) --[==[ Enter this to run tests in the Lua console: =getmetatable(p).quickTests() --]==]
return p</text>
<sha1>n6dnippb8dl8nupbrxgqviac0hno50v</sha1>
</revision>
</page>
<page>
<title>Module:Dir/RTL overrides</title>
<ns>828</ns>
<id>95388411</id>
<revision>
<id>1223091335</id>
<timestamp>2020-07-03T04:07:06Z</timestamp>
<contributor>
<username>Amitie 10g</username>
<id>185006</id>
</contributor>
<comment>Created page with "local p = {} --[==[ Basic input sequences: relative order or duplicates does not matter here (but the end of the self test displays them sorted and deduplicated), but codes m..."</comment>
<origin>1223091335</origin>
<model>Scribunto</model>
<format>text/plain</format>
<text bytes="4566" sha1="cxld5o18iaxkhru8z4aje5lec04qed1" xml:space="preserve">local p = {}
--[==[ Basic input sequences: relative order or duplicates does not matter here (but the end of the self test displays them sorted and deduplicated), but codes must be valid and belong to only one of the two sequences).
Any missing language code will be checked with mw.language.new(code):isRTL(), which is costly in loaded resources (it can only check 20 languages at most including the content language) So it is best to map all languages that are the most likely to be used. --]==]
local rtlLangs = { 'aeb', 'aeb-arab', 'ar', 'arc', 'arq', 'ary', 'arz', 'azb', 'bcc', 'bgn', 'bqi', 'ckb', 'dv', 'fa', 'fa-af', 'glk', 'ha-arab', 'he', 'khw', 'kk-arab', 'kk-cn', 'ks-arab', 'ku-arab', 'lki', 'lrc', 'luz', 'mzn', 'nqo', 'ota', 'pnb', 'prd', 'ps', 'sd', 'sdh', 'skr', 'skr-arab', 'ug', 'ug-arab', 'ur', 'uz-arab', 'ydd', 'yi' }
local ltrLangs = { 'aa', 'ab', 'abs', 'ace', 'ady', 'ady-cyrl', 'aeb-latn', 'af', 'ak', 'aln', 'als', 'alt', 'am', 'ami', 'an', 'ang', 'anp', 'arn', 'as', 'ase', 'ast', 'atj', 'av', 'avk', 'awa', 'ay', 'az', 'ba', 'ban', 'bar', 'bat-smg', 'bbc', 'bbc-latn', 'bcl', 'be', 'be-tarask', 'be-x-old', 'bg', 'bh', 'bho', 'bi', 'bjn', 'bm', 'bn', 'bo', 'bpy', 'br', 'brh', 'bs', 'btm', 'bto', 'bu', 'bug', 'bxr', 'ca', 'cbk-zam', 'cdo', 'ce', 'ceb', 'ch', 'cho', 'chr', 'chy', 'co', 'cop', 'cps', 'cr', 'crh', 'crh-cyrl', 'crh-latn', 'cs', 'csb', 'cu', 'cv', 'cy', 'da', 'de', 'de-at', 'de-ch', 'de-formal', 'din', 'diq', 'dsb', 'dtp', 'dty', 'dz', 'ee', 'egl', 'el', 'eml', 'en', 'en-ca', 'en-gb', 'en-ie', 'en-us', 'eo', 'es', 'es-419', 'es-formal', 'et', 'eu', 'ext', 'ff', 'fi', 'fil', 'fit', 'fiu-vro', 'fj', 'fkv', 'fo', 'fr', 'frc', 'fro', 'frp', 'frr', 'fur', 'fy', 'ga', 'gag', 'gan', 'gan-hans', 'gan-hant', 'gcf', 'gcr', 'gd', 'gl', 'gn', 'gom', 'gom-deva', 'gom-latn', 'gor', 'got', 'grc', 'gsw', 'gu', 'gv', 'ha', 'hak', 'haw', 'hi', 'hif', 'hif-deva', 'hif-latn', 'hil', 'hmn', 'ho', 'hr', 'hrx', 'hsb', 'ht', 'hu', 'hu-formal', 'hy', 'hyw', 'hz', 'ia', 'id', 'ie', 'ig', 'ii', 'ik', 'ike-cans', 'ike-latn', 'ilo', 'inh', 'io', 'is', 'it', 'iu', 'ja', 'jam', 'jbo', 'jut', 'jv', 'ka', 'kaa', 'kab', 'kbd', 'kbd-cyrl', 'kbd-latn', 'kbp', 'kea', 'kg', 'ki', 'kiu', 'kj', 'kjp', 'kk', 'kk-cyrl', 'kk-kz', 'kk-latn', 'kk-tr', 'kl', 'km', 'kn', 'ko', 'ko-kp', 'ko-kr', 'koi', 'kr', 'krc', 'kri', 'krj', 'krl', 'ks', 'ks-deva', 'ksh', 'ku', 'ku-latn', 'kum', 'kv', 'kw', 'ky', 'la', 'lad', 'lb', 'lbe', 'lez', 'lfn', 'lg', 'li', 'lij', 'liv', 'lld', 'lmo', 'ln', 'lo', 'loz', 'lt', 'ltg', 'lus', 'lv', 'lzh', 'lzz', 'mai', 'map-bms', 'mdf', 'mg', 'mh', 'mhr', 'mi', 'min', 'mk', 'ml', 'mn', 'mni', 'mnw', 'mo', 'mr', 'mrj', 'ms', 'mt', 'mus', 'mwl', 'my', 'myv', 'na', 'nah', 'nan', 'nap', 'nb', 'nds', 'nds-nl', 'ne', 'new', 'ng', 'niu', 'nl', 'nl-informal', 'nn', 'no', 'nod', 'non', 'nov', 'nrf', 'nrf-fr', 'nrf-gg', 'nrf-je', 'nrm', 'nso', 'nv', 'ny', 'nys', 'oc', 'olo', 'om', 'or', 'os', 'pa', 'pag', 'pam', 'pap', 'pcd', 'pdc', 'pdt', 'pfl', 'pi', 'pih', 'pl', 'pms', 'pnt', 'prg', 'pt', 'pt-br', 'pt-cv', 'pt-pt', 'qu', 'quc', 'qug', 'rgn', 'rif', 'rm', 'rmf', 'rmy', 'rn', 'ro', 'roa-rup', 'roa-tara', 'ru', 'rue', 'rup', 'ruq', 'ruq-cyrl', 'ruq-latn', 'rw', 'rwr', 'sa', 'sah', 'sat', 'sc', 'scd', 'scn', 'sco', 'sdc', 'se', 'sei', 'ses', 'sg', 'sgs', 'sh', 'sh-cyrl', 'sh-latn', 'shi', 'shi-latn', 'shi-tfng', 'shn', 'shy-latn', 'si', 'simple', 'sjd', 'sje', 'sju', 'sk', 'sl', 'sli', 'sm', 'sma', 'smj', 'smn', 'sms', 'sn', 'so', 'sq', 'sr', 'sr-cyrl', 'sr-ec', 'sr-el', 'sr-latn', 'srn', 'srq', 'ss', 'st', 'stq', 'sty', 'su', 'sv', 'sw', 'szl', 'szy', 'ta', 'tay', 'tcy', 'te', 'tet', 'tg', 'tg-cyrl', 'tg-latn', 'th', 'ti', 'tk', 'tl', 'tly', 'tn', 'to', 'tokipona', 'tpi', 'tr', 'tru', 'trv', 'ts', 'tt', 'tt-cyrl', 'tt-latn', 'tum', 'tw', 'ty', 'tyv', 'tzl', 'tzm', 'udm', 'ug-latn', 'uk', 'uz', 'uz-cyrl', 'uz-latn', 've', 'vec', 'vep', 'vi', 'vls', 'vmf', 'vo', 'vot', 'vro', 'wa', 'war', 'wo', 'wuu', 'xal', 'xh', 'xmf', 'xsy', 'yo', 'yue', 'za', 'zea', 'zgh', 'zh', 'zh-classical', 'zh-cn', 'zh-hans', 'zh-hant', 'zh-hk', 'zh-min-nan', 'zh-mo', 'zh-my', 'zh-sg', 'zh-tw', 'zh-wuu', 'zh-yue', 'zu' }
-- Build the inverted map of languages to direction returned by this data module (fast, but collisions are not checked: run the test module) for _, lang in ipairs(rtlLangs) do p[lang] = true end for _, lang in ipairs(ltrLangs) do p[lang] = false end
-- Also store the two lists (at boolean indice), used by the test module to check the inverted map p[true] = rtlLangs p[false] = ltrLangs
return p</text>
<sha1>cxld5o18iaxkhru8z4aje5lec04qed1</sha1>
</revision>
</page>
<page>
<title>Template:SPARQLText</title>
<ns>10</ns>
<id>23033014</id>
<revision>
<id>1399250943</id>
<parentid>1399250772</parentid>
<timestamp>2021-04-10T14:44:00Z</timestamp>
<contributor>
<ip>87.126.92.234</ip>
</contributor>
<comment>Undid revision 1399250772 by 87.126.92.234 (talk)</comment>
<origin>1399250943</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="340" sha1="f35rnwtdn4sdogbp73jb3irfk0cvqp7" xml:space="preserve">{{#if:|
Template:IfTemplate:IfTemplate:IfTemplate:If }}SELECT ?pop WHERE {
wd:Q2807 wdt:P1082 ?pop
}<noinclude>Template:Doc</noinclude></text>
<sha1>f35rnwtdn4sdogbp73jb3irfk0cvqp7</sha1>
</revision>
</page>
<page>
<title>Template:Int try it</title>
<ns>10</ns>
<id>109708780</id>
<redirect title="Template:Int run it" />
<revision>
<id>1764769125</id>
<timestamp>2022-11-04T21:44:15Z</timestamp>
<contributor>
<username>عُثمان</username>
<id>5050751</id>
</contributor>
<comment>عُثمان moved page Template:Int try it to Template:Int run it: the recent change to run it seems fine, but I was confused about where to find the template since the name did not match - move is inaccordance; redirects should resolve</comment>
<origin>1764769125</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="33" sha1="jwzw36nb8jui2zuk88ncwnse88o65qy" xml:space="preserve">#REDIRECT Template:Int run it</text>
<sha1>jwzw36nb8jui2zuk88ncwnse88o65qy</sha1>
</revision>
</page>
<page>
<title>Module:SPARQLMentions</title>
<ns>828</ns>
<id>28161729</id>
<revision>
<id>1453690994</id>
<parentid>661638891</parentid>
<timestamp>2021-07-04T13:54:47Z</timestamp>
<contributor>
<username>Azertus</username>
<id>1229135</id>
</contributor>
<comment>add getTitle</comment>
<origin>1453690994</origin>
<model>Scribunto</model>
<format>text/plain</format>
<text bytes="2760" sha1="lahzcbsmcekjpuk5o23yy8vvav8qfnz" xml:space="preserve">local p = {}
-- Return the label of a given data item, formatted for linking local function getLabel(frame, id, prefix) if prefix == nil then prefix = end if id == "defaultView:BubbleChart" then id = "Q24515280" end if id == "defaultView:Graph" then id = "Q24515287" end if id == "defaultView:Map" then id = "Q24515275" end
if id == "defaultView:ImageGrid" then id = "Q24515278" end
if id == "wikibase:box" then id = "Q26211169" end if id == "wikibase:cornerWest" then id = "Q26211177" end label = mw.wikibase.label( id ) if label == nil then linktext = id extra = else linktext = label .. " (" .. id .. ")" extra = ' ' .. frame:expandTemplate({ title="Reasonator", args= { [1] = id}}) .. ' ' .. frame:expandTemplate({ title="SQID", args= { [1] = id}}) end
link = mw.wikibase.getEntityUrl( id )
return '[' .. link .. ' ' .. linktext .. ']' .. extra; end
local function map(func, array)
local new_array = {}
for i,v in ipairs(array) do
new_array[i] = func(v)
end
return new_array
end
local function getAll(text, regexp, seen, items) if items == nil then items = {} end if seen == nil then seen = {} end for item in string.gmatch(text, regexp) do if seen[item] == nil then seen[item] = 1 table.insert(items, item) end end return items end
-- Produce list of items mentioned in the query
function p.getItems(frame)
if not mw.wikibase then
return "no mw.wikibase"
end
items = getAll(frame.args[1], 'wd:(Q%d+)') return table.concat(map(function(it) return getLabel(frame, it) end, items), ", ") end
-- Produce list of properties mentioned in the query function p.getProperties(frame) if not mw.wikibase then return "no mw.wikibase" end
seen = {} items = {} prefixes = {'wdt', 'p', 'ps', 'pr', 'pq', 'psv', 'pv', 'prv', 'pqv', 'wdtn', 'psn', 'pqn', 'prn', 'wdno' } for _, pr in ipairs(prefixes) do items = getAll(frame.args[1], pr .. ':(P%d+)', seen, items) end return table.concat(map(function(it) return getLabel(frame, it, 'Property:') end, items), ", ") end
function p.getFunctions(frame) if not mw.wikibase then return "no mw.wikibase" end
seen = {} items = {} func = {'defaultView:BubbleChart', 'defaultView:Graph', 'defaultView:Map', 'defaultView:ImageGrid', 'wikibase:box', "wikibase:cornerWest" } for _, pr in ipairs(func) do items = getAll(frame.args[1], pr, seen, items) end return table.concat(map(function(it) return getLabel(frame, it) end, items), ", ") end
function p.getTitle(frame) if not mw.wikibase then return "no mw.wikibase" end
for line in string.gmatch(frame.args[1], "[^%c]+%c?") do local title = string.match(line, '^#title:%s*([^%c]+)')
if not (title == nil) then return title end end end
return p</text>
<sha1>lahzcbsmcekjpuk5o23yy8vvav8qfnz</sha1>
</revision>
</page>
<page>
<title>Template:SQID</title>
<ns>10</ns>
<id>26259378</id>
<revision>
<id>1233859301</id>
<parentid>1227690908</parentid>
<timestamp>2020-07-18T14:13:28Z</timestamp>
<contributor>
<username>MisterSynergy</username>
<id>44949</id>
</contributor>
<comment>move URL to https://sqid.toolforge.org</comment>
<origin>1233859301</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="993" sha1="j6wq5aq6l7wsi92xtysclan6m8dprov" xml:space="preserve"><!--
-->{{#if: | Template:Q  }}<!-- -->{{#if: | Template:P  }}<!-- -->{{#if: | <span class="plainlinks">[https://sqid.toolforge.org/#{{#if:
| /view?id={{#if:
|
| {{#if:
| Q{{#titleparts:}}
| P{{#titleparts:}}
}}
}}&lang=⧼Lang⧽
| /?lang=⧼Lang⧽
}} ]</span>
}}<!-- --><nowiki/>?lang=⧼Lang⧽ }}<!-- --><noinclude>Template:Documentation</noinclude></text>
<sha1>j6wq5aq6l7wsi92xtysclan6m8dprov</sha1>
</revision>
</page>
<page>
<title>Template:Reasonator</title>
<ns>10</ns>
<id>17365939</id>
<revision>
<id>1556587517</id>
<parentid>1507464031</parentid>
<timestamp>2022-01-05T12:35:07Z</timestamp>
<contributor>
<username>Venca24</username>
<id>103280</id>
</contributor>
<comment>+ cs, eo</comment>
<origin>1556587517</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="882" sha1="ej9pd5v5fuipsemxo8gx8dbsqgg5vij" xml:space="preserve">{{#if:
| <span class="plainlinks">[9]</span> }} Template:TranslateThis<noinclude>Template:Documentation</noinclude></text>
<sha1>ej9pd5v5fuipsemxo8gx8dbsqgg5vij</sha1>
</revision>
</page>
<page>
<title>Template:WikiProject</title>
<ns>10</ns>
<id>21790485</id>
<revision>
<id>2298079997</id>
<parentid>2053606357</parentid>
<timestamp>2025-01-14T09:49:46Z</timestamp>
<contributor>
<username>Mormegil</username>
<id>28758</id>
</contributor>
<comment>+cs</comment>
<origin>2298079997</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="2446" sha1="afrxihplnkiijrydcgi7kwzg00a84sv" xml:space="preserve"><noinclude>Template:Doc</noinclude><!--
-->{{#ifexist: Wikidata:WikiProject <!--
#then:
-->|{{#if:<!--
#then:
-->|Template:Section link<!--
#else:
-->|Template:Ll<!--
-->}}<!--
#else:
-->|{{error<!--
-->|Template:TranslateThis<!--
-->}}<!--
--> <small>Template:TranslateThis<!--
--></small><!--
-->}}</text>
<sha1>afrxihplnkiijrydcgi7kwzg00a84sv</sha1>
</revision>
</page>
<page>
<title>Template:WikiProject/pagename</title>
<ns>10</ns>
<id>22491841</id>
<revision>
<id>1294585707</id>
<parentid>238479307</parentid>
<timestamp>2020-10-19T21:05:53Z</timestamp>
<contributor>
<username>Tacsipacsi</username>
<id>33956</id>
</contributor>
<comment>substitute template that doesn’t do what its name suggests and what it does in other projects</comment>
<origin>1294585707</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="60" sha1="8o2k69wu2sme8f490aakwi7ynj63jjv" xml:space="preserve">{{#if:|Wikidata Talk|Wikidata}}:WikiProject {{{1}}}</text>
<sha1>8o2k69wu2sme8f490aakwi7ynj63jjv</sha1>
</revision>
</page>
<page>
<title>Template:ItemOrNot</title>
<ns>10</ns>
<id>28161695</id>
<revision>
<id>361346548</id>
<parentid>361300782</parentid>
<timestamp>2016-08-02T21:22:10Z</timestamp>
<contributor>
<username>Smalyshev (WMF)</username>
<id>1482806</id>
</contributor>
<origin>361346548</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="384" sha1="230nkvb4w9pmw09vu3optxajqkjdr42" xml:space="preserve">{{#if: | * {{{1}}}: | }}<noinclude>
<templatedata> { "params": { "1": { "label": "List item name", "type": "string", "required": true }, "2": { "description": "List item contents", "type": "string" } }, "description": "Displays list item if second argument is not empty, otherwise nothing", "format": "block" } </templatedata> </noinclude></text>
<sha1>230nkvb4w9pmw09vu3optxajqkjdr42</sha1>
</revision>
</page>
<page>
<title>Template:Int Properties</title>
<ns>10</ns>
<id>25945270</id>
<revision>
<id>360948553</id>
<parentid>360948486</parentid>
<timestamp>2016-07-31T15:39:37Z</timestamp>
<contributor>
<username>Airon90</username>
<id>4782</id>
</contributor>
<origin>360948553</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="63" sha1="1f6bvc59pk8lngjngkff5ej07hrd17a" xml:space="preserve"><noinclude>Template:Doc</noinclude>Template:Capitalize</text>
<sha1>1f6bvc59pk8lngjngkff5ej07hrd17a</sha1>
</revision>
</page>
<page>
<title>Template:Int properties</title>
<ns>10</ns>
<id>25941214</id>
<revision>
<id>2504115378</id>
<parentid>2438818739</parentid>
<timestamp>2026-06-10T11:28:12Z</timestamp>
<contributor>
<username>مواطن تونسي</username>
<id>1537128</id>
</contributor>
<minor/>
<comment>traduction ar</comment>
<origin>2504115378</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="746" sha1="ao6colplfei84pspf07jmngpp7arssr" xml:space="preserve"><noinclude>Template:Doc</noinclude>Template:TranslateThis</text>
<sha1>ao6colplfei84pspf07jmngpp7arssr</sha1>
</revision>
</page>
<page>
<title>Template:SPARQL2/doc</title>
<ns>10</ns>
<id>35750675</id>
<revision>
<id>1425856775</id>
<parentid>1425856600</parentid>
<timestamp>2021-05-21T17:39:04Z</timestamp>
<contributor>
<username>PAC2</username>
<id>4892</id>
</contributor>
<comment>/* See also */ typo</comment>
<origin>1425856775</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="533" sha1="p2irk8qhdq7sqdc2n9kyjs3lvi2j5kw" xml:space="preserve"><nowiki>Template loop detected: Template:SPARQL2</nowiki>
Template loop detected: Template:SPARQL2
<nowiki>Template loop detected: Template:SPARQL2</nowiki>
Template loop detected: Template:SPARQL2
<nowiki>Template loop detected: Template:SPARQL2</nowiki>
Template loop detected: Template:SPARQL2
<nowiki>Template loop detected: Template:SPARQL2</nowiki>
Template loop detected: Template:SPARQL2
See also
<sha1>p2irk8qhdq7sqdc2n9kyjs3lvi2j5kw</sha1>
</revision>
</page>
<page>
<title>Template:Int run it</title>
<ns>10</ns>
<id>25022557</id>
<revision>
<id>2438820809</id>
<parentid>2033139854</parentid>
<timestamp>2025-12-06T14:46:20Z</timestamp>
<contributor>
<username>YeBoy371</username>
<id>2200680</id>
</contributor>
<origin>2438820809</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="1085" sha1="8ggotttekjqxrksv8jgpqj8yv3lzvla" xml:space="preserve"><noinclude>Template:Doc</noinclude>Template:TranslateThis</text>
<sha1>8ggotttekjqxrksv8jgpqj8yv3lzvla</sha1>
</revision>
</page>
</mediawiki>
See also
<sha1>p2irk8qhdq7sqdc2n9kyjs3lvi2j5kw</sha1>
</revision>
</page>
<page>
<title>Template:Int run it</title>
<ns>10</ns>
<id>25022557</id>
<revision>
<id>2438820809</id>
<parentid>2033139854</parentid>
<timestamp>2025-12-06T14:46:20Z</timestamp>
<contributor>
<username>YeBoy371</username>
<id>2200680</id>
</contributor>
<origin>2438820809</origin>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="1085" sha1="8ggotttekjqxrksv8jgpqj8yv3lzvla" xml:space="preserve"><noinclude>Template:Doc</noinclude>Template:TranslateThis</text>
<sha1>8ggotttekjqxrksv8jgpqj8yv3lzvla</sha1>
</revision>
</page>
</mediawiki>