{{#invoke:Sandbox/Ahecht/interwiki|isCurrentIW|page name}}
{{#invoke:Sandbox/Ahecht/interwiki|isCurrentIW|Main Page}}
:
false
{{#invoke:Sandbox/Ahecht/interwiki|isCurrentIW|en:Main Page}}
:
true
{{#invoke:Sandbox/Ahecht/interwiki|isCurrentIW|c:Main Page}}
:
false
{{#invoke:Sandbox/Ahecht/interwiki|ifCurrentIW|page name|text if true|text if false}}
{{#invoke:Sandbox/Ahecht/interwiki|ifCurrentIW|c:Main Page|Interwiki link to the current wiki|Not an interwiki link to the current wiki}}
:
Not an interwiki link to the current wiki
{{#invoke:Sandbox/Ahecht/interwiki|ifCurrentIW|w:Main Page|Interwiki link to the current wiki|Not an interwiki link to the current wiki}}
:
Interwiki link to the current wiki
{{#invoke:Sandbox/Ahecht/interwiki|ifCurrentIW|Main Page|Why are you using an interwiki here?}}
:
{{#invoke:Sandbox/Ahecht/interwiki|isValidIW|page name|local=true/false}}
{{#invoke:Sandbox/Ahecht/interwiki|isValidIW|Main Page}}
:
false
{{#invoke:Sandbox/Ahecht/interwiki|isValidIW|de:Main Page}}
:
true
{{#invoke:Sandbox/Ahecht/interwiki|isValidIW|fakewiki:Main Page}}
:
false
{{#invoke:Sandbox/Ahecht/interwiki|isValidIW|openstreetmap:Main Page}}
:
true
{{#invoke:Sandbox/Ahecht/interwiki|isValidIW|openstreetmap:Main Page|local=true}}
:
false
{{#invoke:Sandbox/Ahecht/interwiki|isValidIW|c:Main Page|local=true}}
:
true
{{#invoke:Sandbox/Ahecht/interwiki|ifValidIW|page name|text if true|text if false|local=true/false}}
{{#invoke:Sandbox/Ahecht/interwiki|ifValidIW|c:Main Page|Interwiki link to a valid wiki|Not an interwiki link to a valid wiki}}
:
Interwiki link to a valid wiki
{{#invoke:Sandbox/Ahecht/interwiki|ifValidIW|openstreetmap:Main Page|Interwiki link to a valid local wiki|Not an interwiki link to a valid local wiki|local=true}}
:
Not an interwiki link to a valid local wiki
{{#invoke:Sandbox/Ahecht/interwiki|ifValidIW|Main Page|Interwiki link to a valid wiki}}
:
{{#invoke:Sandbox/Ahecht/interwiki|current|sep=separator between entries}}
{{#invoke:Sandbox/Ahecht/interwiki|current}}
:
w, en
{{#invoke:Sandbox/Ahecht/interwiki|current|sep={{break}}}}
:
w
en
{{#invoke:Sandbox/Ahecht/interwiki|map|sep=separator between entries|local=true/false}}
{{#invoke:Sandbox/Ahecht/interwiki|map}}
:
libreplanet, openstreetmap, ircs, wikidata, dmozs, wmania, wmar, phabricator, sc, ady, urbandict, tmbw, centralwikia, scholar, dicoado, ab, glk, imdbname, hackerspaces, lingualibre, finnix, nb, wikiskripta, googledefine, test2wiki, wm2005, ast, ca, ba, gag, thelemapedia, ga, fa, wmteam, dag, ka, ja, devmo, ami, na, la, sa, infosphere, haw, pa, wa, ta, policy, pokéwiki, wikitech, scn, wikihow, doom_wiki, zh-min-nan, pag, usemod, arborwiki, scramble, c, b, proofwiki, d, tswiki, f, bcl, m, pcm, pcd, q, fedora, s, bxr, w, ace, jbo, hrwiki, wm2010, wikifur, chy, cdo, wmtw, orthodoxwiki, horizonlabs, pokewiki, semantic-mw, sco, nan, theopedia, ban, guildwarswiki, gan, revo, elibre, jam, lad, quality, wmcz_docs, lokalhistoriewiki, outreach, sat, wmfblog, bbc, umap, oclc, kbd, genwiki, kab, wikia, freesoft, dcdatabase, wikinews, ak, werelate, fiu-vro, iarchive, wm2014, nlab, marveldatabase, wmdk, kcg, svn, rfc, sk, mediazilla, uk, tk, mdf, wikiwikiweb, dga, mk, bar, mwod, ext, jira, wikiapiary, doi, wmno, myv, metawikimedia, wcna, en-simple, wikispecies, lzh, mail, kj, koi, wmet, liberachat, vrtwiki, zum, dbdump, xh, wmfi, wmfdashboard, stewardry, wmcz_old, oeis, nost, hrfwiki, moinmoin, dict, wmil, ti, si, wikiti, ii, wm2015, wuu, fi, globalcontribs, li, wm2008, dtp, wmph, swtrain, bh, ch, wikisource, boxrec, bugzilla, rup, wikimedia, ceb, pwn, sh, glottolog, tly, tum, wmmk, vec, debian, uncyclopedia, wikilivres, petscan, wikivoyage, atj, pih, bpy, gutenberg, lg, metawiki, ng, twiki, lostpedia, ig, tg, wmch, betawiki, wikisophia, mixnmatch, securewikidc, pap, za, gcr, shi, metawikipedia, ff, wmromd, karlsruhe, otrswiki, kbp, wmcn, lexemes, sulutil, ckb, mnw, commons, advisory, ee, wmve, ce, be, imdbcompany, nds-nl, wikisp, ne, wikiindex, mwot, gucprefix, ie, he, emacswiki, te, mwl, wikiconference, twl, wmes, wg, oldwikisource, sourceforge, wmcl, dico, flickruser, id, battlestarwiki, gd, usability, testwikidata, gitlab, es, meatball, wmit, foldoc, wmsk, ethnologue, lofc, olpc, strategywiki, ss, c2, wikiedudashboard, ur, spcom, isni, disinfopedia, discord, as, localwiki, cs, bs, issn, fr, wmdc, exkcd, wmat, kr, wmpunjabi, or, frp, sr, voy, dpd, v, chapter, n, wikt, wm2018, crh, wmec, smn, mr, ar, br, cr, wmnl, scores, cmn, zh-tw, lld, jp, epo, dk, nds, ksh, ko, lmo, sq, zh-yue, zh-classical, zh, creativecommonswiki, zgh, zea, is, arz, yo, af, xmf, xal, quarry, iso639-3, wo, diffblog, war, sgs, ary, wm2012, oc, vls, flickrphoto, be-tarask, sn, fon, ug, ve, uz, vep, udm, google, tyv, ty, tw, gentoo, wiktionary, ticket, weirdgloop, toolforge, wmde, viaf, ts, trv, mediawikiwiki, tr, sw, szl, simple, wmge, fanimutationwiki, bo, foundationsite, nso, co, wmhu, btm, tl, wmrs, mozillazinekb, th, englyphwiki, tet, tcy, als, tay, hyw, ro, pnt, to, so, no, wm2016, tpi, etherpad, sv, io, lo, wikinvest, fo, bibcode, phab, su, alt, bn, rev, irc, anp, stq, dsb, mozillawiki, yi, srn, hsb, vi, qu, sl, skr, freedomdefined, inh, rn, wmpl, tn, mn, freenode, shy, mrj, gutenbergwiki, vro, kn, ln, en, sg, gn, wmdoc, nqo, wm2006, bm, am, se, mhr, sd, sah, diq, mailarchive, rue, botwiki, wmee, ru, roa-tara, wmbd, rmy, sm, rm, nrm, wmuk, wikipedia, wmfr, ps, pnb, km, aew, arc, pms, mni, enkol, pl, pi, comune, gu, nov, pdc, ltg, pam, os, om, donate, wikitrek, encyc, vo, ny, chr, new, memoryalpha, wmmx, sep11, choralwiki, nn, wm2017, wm2011, nl, bug, nia, nap, rodovid, gl, nah, el, mzn, it, mus, mt, igl, ms, acronym, shn, egl, mo, ml, wikispore, mi, slashdot, mh, mg, map-bms, mai, mad, lv, lt, lrc, incubator, wurmpedia, aquariumwiki, wikiversity, zh-cn, lij, planetmath, lfn, lez, unihan, lbe, jaglyphwiki, lb, ilo, fat, wmbe, cbk-zam, sharemap, kus, wmplsite, cz, dz, ks, toollabs, krc, hz, awa, zu, wmhk, kl, tyvawiki, kk, ki, freebsdman, az, hif, gor, arxiv, kg, kaa, jv, gardenology, iu, my, yue, ky, citizendium, ik, guc, bcnbio, wmnyc, ia, dty, cy, wmtr, vrts, hy, rcirc, fy, olo, nostalgia, wikibooks, ircrc, ay, tardis, wmke, szy, schoolswp, hu, wmpt, de, creativecommons, wikinfo, hr, ho, bat-smg, hi, wikicity, listarchive, paws, hak, ha, wikilivresru, guw, hammondwiki, mdwiki, pfl, tools, tclerswiki, esolang, gsw, gpe, stats, got, wmdeblog, gom, kamelo, aa, wookieepedia, da, be-x-old, scoutwiki, tenwiki, linguistlist, organicdesign, xtools, foundation, tviv, iuridictum, wm2007, wikispot, senseislibrary, komicawiki, betawikiversity, fj, mosapedia, dictionary, rw, exotica, beacha, kw, xkcd, mw, bg, baden, communityscheme, wm2013, appropedia, wmin, owasp, openlibrary, eo, eml, wmua, gerrit, outreachwiki, translatewiki, wmca, omegawiki, gv, drae, download, cache, wmpa-us, dv, regiowiki, roa-rup, hdl, cv, googlegroups, csb, kv, species, wmf, nv, pmid, din, wmco, cho, meta, nara, wmse, wikiquote, min, wmid, av, blk, wmhi, ethnologuefamily, bjn, openwetware, bi, toolhub, dmoz, livepedia, wmcz, eu, bew, cu, azb, wm2009, mariowiki, wmam, wikicities, osmwiki, finalfantasy, ku, votewiki, dpla, bibliowiki, rheinneckar, an, heraldik, st, tt, git, avk, pyrev, wowwiki, frr, vlos, vikidia, wmza, lojban, otrs, wmru, ht, et, strategy, tfwiki, testwiki, mineralienatlas, rt, wikifunctions, pt, ang, wikimania, glottopedia, utrs, antwiki, wmbr, wmau, labsconsole, fur, gur, jstor, wikipediawikipedia, wikipapers, luxo, wikiasite, pythoninfo, bulba, silcode, imdbtitle, communitywiki
{{#invoke:Sandbox/Ahecht/interwiki|map|local=true|sep=; }}
:
wikidata; wmania; oc; phabricator; sc; blk; ab; glk; lb; nb; xal; test2wiki; wm2005; ast; ca; ba; gag; ga; fa; wmteam; dag; kus; ja; mus; ha; na; la; sa; haw; pa; wa; ta; policy; wikitech; scn; betawikiversity; zh-min-nan; pag; lij; stq; votewiki; c; b; nah; d; tswiki; f; bcl; m; pcm; pcd; q; s; bxr; w; ace; jbo; wm2010; chy; cdo; wmtw; horizonlabs; shy; sco; nan; wmza; ban; gan; jam; lad; fat; tenwiki; sat; kaa; lbe; lez; kbd; kab; sah; wikinews; ak; fiu-vro; bibliowiki; dk; wmdk; kcg; svn; sk; mediazilla; uk; tk; mdf; ik; kk; mk; bar; ext; wmno; myv; metawikimedia; en-simple; wikispecies; lzh; mail; kj; koi; wmet; vrtwiki; bi; xh; wmfi; zh-classical; testwiki; nost; pdc; wmil; ti; si; ii; wmam; wuu; fi; hyw; li; wm2008; dtp; wmph; bh; ch; wikisource; wmtr; bugzilla; rup; wikimedia; ceb; pwn; sh; tly; tum; wmmk; vec; wikilivres; wikivoyage; atj; pih; bpy; bg; lg; metawiki; ng; mg; ig; tg; sg; wikisophia; wmbd; pap; za; gcr; shi; foundation; ff; wmromd; af; otrswiki; kbp; wmcn; lexemes; sulutil; ckb; mnw; commons; advisory; ee; wmve; ce; be; nds-nl; wmbr; ne; ie; he; ve; te; mwl; wg; oldwikisource; id; gd; usability; testwikidata; gitlab; dty; is; ks; ms; trv; ps; ss; wikipediawikipedia; pnb; ur; spcom; gpe; as; bat-smg; bs; listarchive; fr; hr; kr; mr; or; sgs; sr; wm2018; crh; wmec; smn; ar; gom; cr; wmnl; stats; nds; lmo; sq; arz; diffblog; ary; wm2012; be-tarask; fon; vep; wiktionary; ticket; mailarchive; mediawikiwiki; wmge; bo; foundationsite; nso; wm2013; wmin; wmrs; als; roa-tara; pnt; to; so; no; mo; tpi; eml; io; lo; outreachwiki; fo; eo; ho; an; csb; rev; anp; dsb; yi; hsb; vi; inh; rn; wmpl; tn; mn; nn; gutenbergwiki; vro; kn; ln; en; gn; wmdoc; nqo; wm2006; bm; am; mhr; got; botwiki; wmee; sm; rm; nrm; wmuk; om; km; arc; mni; wmse; nov; ltg; donate; vo; new; sl; wmmx; sep11; chr; pl; ml; nl; kl; gl; el; igl; shn; egl; incubator; wikiversity; zh-cn; uz; chapter; wmbe; cbk-zam; cz; dz; hz; awa; zu; wmhk; tyvawiki; az; hif; gor; my; yue; ky; voy; v; guc; n; wmnyc; wikt; cmn; cy; es; zh-tw; hy; rcirc; fy; olo; nostalgia; wikibooks; ircrc; ay; jp; wmke; szy; vrts; epo; pam; os; mrj; lfn; hi; schoolswp; ksh; mad; vls; wmar; zh; zgh; zea; cs; mh; ady; yo; pfl; srn; xmf; mai; wmpunjabi; frp; wo; war; sn; br; ilo; de; hak; aa; be-x-old; rue; da; ka; ia; ami; ug; udm; tyv; wm2007; labsconsole; ty; tw; btm; co; ts; tr; rw; szl; lld; kw; tl; mw; lrc; th; tet; tcy; sv; tay; ro; wm2016; etherpad; sw; wikinvest; gerrit; phab; alt; wmca; bn; gv; su; download; wmau; cv; dv; pi; roa-rup; se; skr; freenode; nia; kv; species; wmf; nv; wikimania; din; wmco; sharemap; meta; simple; diq; wikiquote; min; wmid; av; jv; quality; wikipedia; sd; pms; outreach; toolhub; hu; gu; wmhi; eu; wmfblog; cu; azb; wm2009; kg; iu; ru; bbc; gsw; ku; rmy; qu; wm2017; wm2011; bug; zh-yue; st; tt; git; avk; pyrev; krc; frr; wm2014; lt; ny; it; otrs; fj; ht; et; strategy; dga; nap; mzn; rt; wikifunctions; pt; ang; wm2015; bjn; wmua; mt; cho; mi; map-bms; fur; gur; lv; wmpt; ko; ki; guw; metawikipedia; wmpa-us; wmru; dbdump; bew
local p = {}
function p._current()
out = {}
for k, v in pairs(mw.site.interwikiMap("local")) do
if v.isCurrentWiki then
table.insert(out, k)
end
end
return out
end
function p._map(isLocal)
isLocal = isLocal and "local" or nil
out = {}
for k, v in pairs(mw.site.interwikiMap(isLocal)) do
table.insert(out, k)
end
return out
end
function p._isCurrentIW(title)
for _, v in ipairs(p._current()) do
pattern = "^:?" .. v .. ":"
if mw.ustring.match(title, pattern) then
return true
end
end
return false
end
function p._isValidIW(title, isLocal)
for _, v in ipairs(p._map(isLocal)) do
pattern = "^:?" .. v .. ":"
if mw.ustring.match(title, pattern) then
return true
end
end
return false
end
local function current(args)
return table.concat(p._current(), (args.sep or ", "))
end
local function map(args)
return table.concat(p._map(args"local"]), (args.sep or ", "))
end
local function isCurrentIW(args)
return p._isCurrentIW((args1 or ""))
end
local function ifCurrentIW(args)
if p._isCurrentIW((args1 or "")) then
return args2 or ""
else
return args3 or ""
end
end
local function isValidIW(args)
return p._isValidIW((args1 or ""), args"local"])
end
local function ifValidIW(args)
if p._isValidIW((args1 or ""), args"local"]) then
return args2 or ""
else
return args3 or ""
end
end
local function makeWrapper(func)
return function (frame)
-- If called via #invoke, use the args passed into the invoking template.
-- Otherwise, for testing purposes, assume args are being passed directly in.
local origArgs
if frame == mw.getCurrentFrame() then
origArgs = frame:getParent().args
for k, v in pairs(frame.args) do
origArgs = frame.args
break
end
else
origArgs = frame
end
-- Strip whitespace, and treat blank arguments as nil.
-- 'sep' has different behaviour depending on whether
-- it is blank or nil, so keep it as it is.
-- isLocal needs to be converted from a string to a bool.
local args = {}
for k, v in pairs(origArgs) do
v = mw.text.trim(v)
if v ~= '' or k == 'sep' then
if k == 'local' then
t = {["true"=true,["false"=false}
argsk = (tv or v==true)
else
argsk = v
end
end
end
return func(args)
end
end
return {
current = makeWrapper(current),
map = makeWrapper(map),
isCurrentIW = makeWrapper(isCurrentIW),
ifCurrentIW = makeWrapper(ifCurrentIW),
isValidIW = makeWrapper(isValidIW),
ifValidIW = makeWrapper(ifValidIW)
}
{{#invoke:Sandbox/Ahecht/interwiki|isCurrentIW|page name}}
{{#invoke:Sandbox/Ahecht/interwiki|isCurrentIW|Main Page}}
:
false
{{#invoke:Sandbox/Ahecht/interwiki|isCurrentIW|en:Main Page}}
:
true
{{#invoke:Sandbox/Ahecht/interwiki|isCurrentIW|c:Main Page}}
:
false
{{#invoke:Sandbox/Ahecht/interwiki|ifCurrentIW|page name|text if true|text if false}}
{{#invoke:Sandbox/Ahecht/interwiki|ifCurrentIW|c:Main Page|Interwiki link to the current wiki|Not an interwiki link to the current wiki}}
:
Not an interwiki link to the current wiki
{{#invoke:Sandbox/Ahecht/interwiki|ifCurrentIW|w:Main Page|Interwiki link to the current wiki|Not an interwiki link to the current wiki}}
:
Interwiki link to the current wiki
{{#invoke:Sandbox/Ahecht/interwiki|ifCurrentIW|Main Page|Why are you using an interwiki here?}}
:
{{#invoke:Sandbox/Ahecht/interwiki|isValidIW|page name|local=true/false}}
{{#invoke:Sandbox/Ahecht/interwiki|isValidIW|Main Page}}
:
false
{{#invoke:Sandbox/Ahecht/interwiki|isValidIW|de:Main Page}}
:
true
{{#invoke:Sandbox/Ahecht/interwiki|isValidIW|fakewiki:Main Page}}
:
false
{{#invoke:Sandbox/Ahecht/interwiki|isValidIW|openstreetmap:Main Page}}
:
true
{{#invoke:Sandbox/Ahecht/interwiki|isValidIW|openstreetmap:Main Page|local=true}}
:
false
{{#invoke:Sandbox/Ahecht/interwiki|isValidIW|c:Main Page|local=true}}
:
true
{{#invoke:Sandbox/Ahecht/interwiki|ifValidIW|page name|text if true|text if false|local=true/false}}
{{#invoke:Sandbox/Ahecht/interwiki|ifValidIW|c:Main Page|Interwiki link to a valid wiki|Not an interwiki link to a valid wiki}}
:
Interwiki link to a valid wiki
{{#invoke:Sandbox/Ahecht/interwiki|ifValidIW|openstreetmap:Main Page|Interwiki link to a valid local wiki|Not an interwiki link to a valid local wiki|local=true}}
:
Not an interwiki link to a valid local wiki
{{#invoke:Sandbox/Ahecht/interwiki|ifValidIW|Main Page|Interwiki link to a valid wiki}}
:
{{#invoke:Sandbox/Ahecht/interwiki|current|sep=separator between entries}}
{{#invoke:Sandbox/Ahecht/interwiki|current}}
:
w, en
{{#invoke:Sandbox/Ahecht/interwiki|current|sep={{break}}}}
:
w
en
{{#invoke:Sandbox/Ahecht/interwiki|map|sep=separator between entries|local=true/false}}
{{#invoke:Sandbox/Ahecht/interwiki|map}}
:
libreplanet, openstreetmap, ircs, wikidata, dmozs, wmania, wmar, phabricator, sc, ady, urbandict, tmbw, centralwikia, scholar, dicoado, ab, glk, imdbname, hackerspaces, lingualibre, finnix, nb, wikiskripta, googledefine, test2wiki, wm2005, ast, ca, ba, gag, thelemapedia, ga, fa, wmteam, dag, ka, ja, devmo, ami, na, la, sa, infosphere, haw, pa, wa, ta, policy, pokéwiki, wikitech, scn, wikihow, doom_wiki, zh-min-nan, pag, usemod, arborwiki, scramble, c, b, proofwiki, d, tswiki, f, bcl, m, pcm, pcd, q, fedora, s, bxr, w, ace, jbo, hrwiki, wm2010, wikifur, chy, cdo, wmtw, orthodoxwiki, horizonlabs, pokewiki, semantic-mw, sco, nan, theopedia, ban, guildwarswiki, gan, revo, elibre, jam, lad, quality, wmcz_docs, lokalhistoriewiki, outreach, sat, wmfblog, bbc, umap, oclc, kbd, genwiki, kab, wikia, freesoft, dcdatabase, wikinews, ak, werelate, fiu-vro, iarchive, wm2014, nlab, marveldatabase, wmdk, kcg, svn, rfc, sk, mediazilla, uk, tk, mdf, wikiwikiweb, dga, mk, bar, mwod, ext, jira, wikiapiary, doi, wmno, myv, metawikimedia, wcna, en-simple, wikispecies, lzh, mail, kj, koi, wmet, liberachat, vrtwiki, zum, dbdump, xh, wmfi, wmfdashboard, stewardry, wmcz_old, oeis, nost, hrfwiki, moinmoin, dict, wmil, ti, si, wikiti, ii, wm2015, wuu, fi, globalcontribs, li, wm2008, dtp, wmph, swtrain, bh, ch, wikisource, boxrec, bugzilla, rup, wikimedia, ceb, pwn, sh, glottolog, tly, tum, wmmk, vec, debian, uncyclopedia, wikilivres, petscan, wikivoyage, atj, pih, bpy, gutenberg, lg, metawiki, ng, twiki, lostpedia, ig, tg, wmch, betawiki, wikisophia, mixnmatch, securewikidc, pap, za, gcr, shi, metawikipedia, ff, wmromd, karlsruhe, otrswiki, kbp, wmcn, lexemes, sulutil, ckb, mnw, commons, advisory, ee, wmve, ce, be, imdbcompany, nds-nl, wikisp, ne, wikiindex, mwot, gucprefix, ie, he, emacswiki, te, mwl, wikiconference, twl, wmes, wg, oldwikisource, sourceforge, wmcl, dico, flickruser, id, battlestarwiki, gd, usability, testwikidata, gitlab, es, meatball, wmit, foldoc, wmsk, ethnologue, lofc, olpc, strategywiki, ss, c2, wikiedudashboard, ur, spcom, isni, disinfopedia, discord, as, localwiki, cs, bs, issn, fr, wmdc, exkcd, wmat, kr, wmpunjabi, or, frp, sr, voy, dpd, v, chapter, n, wikt, wm2018, crh, wmec, smn, mr, ar, br, cr, wmnl, scores, cmn, zh-tw, lld, jp, epo, dk, nds, ksh, ko, lmo, sq, zh-yue, zh-classical, zh, creativecommonswiki, zgh, zea, is, arz, yo, af, xmf, xal, quarry, iso639-3, wo, diffblog, war, sgs, ary, wm2012, oc, vls, flickrphoto, be-tarask, sn, fon, ug, ve, uz, vep, udm, google, tyv, ty, tw, gentoo, wiktionary, ticket, weirdgloop, toolforge, wmde, viaf, ts, trv, mediawikiwiki, tr, sw, szl, simple, wmge, fanimutationwiki, bo, foundationsite, nso, co, wmhu, btm, tl, wmrs, mozillazinekb, th, englyphwiki, tet, tcy, als, tay, hyw, ro, pnt, to, so, no, wm2016, tpi, etherpad, sv, io, lo, wikinvest, fo, bibcode, phab, su, alt, bn, rev, irc, anp, stq, dsb, mozillawiki, yi, srn, hsb, vi, qu, sl, skr, freedomdefined, inh, rn, wmpl, tn, mn, freenode, shy, mrj, gutenbergwiki, vro, kn, ln, en, sg, gn, wmdoc, nqo, wm2006, bm, am, se, mhr, sd, sah, diq, mailarchive, rue, botwiki, wmee, ru, roa-tara, wmbd, rmy, sm, rm, nrm, wmuk, wikipedia, wmfr, ps, pnb, km, aew, arc, pms, mni, enkol, pl, pi, comune, gu, nov, pdc, ltg, pam, os, om, donate, wikitrek, encyc, vo, ny, chr, new, memoryalpha, wmmx, sep11, choralwiki, nn, wm2017, wm2011, nl, bug, nia, nap, rodovid, gl, nah, el, mzn, it, mus, mt, igl, ms, acronym, shn, egl, mo, ml, wikispore, mi, slashdot, mh, mg, map-bms, mai, mad, lv, lt, lrc, incubator, wurmpedia, aquariumwiki, wikiversity, zh-cn, lij, planetmath, lfn, lez, unihan, lbe, jaglyphwiki, lb, ilo, fat, wmbe, cbk-zam, sharemap, kus, wmplsite, cz, dz, ks, toollabs, krc, hz, awa, zu, wmhk, kl, tyvawiki, kk, ki, freebsdman, az, hif, gor, arxiv, kg, kaa, jv, gardenology, iu, my, yue, ky, citizendium, ik, guc, bcnbio, wmnyc, ia, dty, cy, wmtr, vrts, hy, rcirc, fy, olo, nostalgia, wikibooks, ircrc, ay, tardis, wmke, szy, schoolswp, hu, wmpt, de, creativecommons, wikinfo, hr, ho, bat-smg, hi, wikicity, listarchive, paws, hak, ha, wikilivresru, guw, hammondwiki, mdwiki, pfl, tools, tclerswiki, esolang, gsw, gpe, stats, got, wmdeblog, gom, kamelo, aa, wookieepedia, da, be-x-old, scoutwiki, tenwiki, linguistlist, organicdesign, xtools, foundation, tviv, iuridictum, wm2007, wikispot, senseislibrary, komicawiki, betawikiversity, fj, mosapedia, dictionary, rw, exotica, beacha, kw, xkcd, mw, bg, baden, communityscheme, wm2013, appropedia, wmin, owasp, openlibrary, eo, eml, wmua, gerrit, outreachwiki, translatewiki, wmca, omegawiki, gv, drae, download, cache, wmpa-us, dv, regiowiki, roa-rup, hdl, cv, googlegroups, csb, kv, species, wmf, nv, pmid, din, wmco, cho, meta, nara, wmse, wikiquote, min, wmid, av, blk, wmhi, ethnologuefamily, bjn, openwetware, bi, toolhub, dmoz, livepedia, wmcz, eu, bew, cu, azb, wm2009, mariowiki, wmam, wikicities, osmwiki, finalfantasy, ku, votewiki, dpla, bibliowiki, rheinneckar, an, heraldik, st, tt, git, avk, pyrev, wowwiki, frr, vlos, vikidia, wmza, lojban, otrs, wmru, ht, et, strategy, tfwiki, testwiki, mineralienatlas, rt, wikifunctions, pt, ang, wikimania, glottopedia, utrs, antwiki, wmbr, wmau, labsconsole, fur, gur, jstor, wikipediawikipedia, wikipapers, luxo, wikiasite, pythoninfo, bulba, silcode, imdbtitle, communitywiki
{{#invoke:Sandbox/Ahecht/interwiki|map|local=true|sep=; }}
:
wikidata; wmania; oc; phabricator; sc; blk; ab; glk; lb; nb; xal; test2wiki; wm2005; ast; ca; ba; gag; ga; fa; wmteam; dag; kus; ja; mus; ha; na; la; sa; haw; pa; wa; ta; policy; wikitech; scn; betawikiversity; zh-min-nan; pag; lij; stq; votewiki; c; b; nah; d; tswiki; f; bcl; m; pcm; pcd; q; s; bxr; w; ace; jbo; wm2010; chy; cdo; wmtw; horizonlabs; shy; sco; nan; wmza; ban; gan; jam; lad; fat; tenwiki; sat; kaa; lbe; lez; kbd; kab; sah; wikinews; ak; fiu-vro; bibliowiki; dk; wmdk; kcg; svn; sk; mediazilla; uk; tk; mdf; ik; kk; mk; bar; ext; wmno; myv; metawikimedia; en-simple; wikispecies; lzh; mail; kj; koi; wmet; vrtwiki; bi; xh; wmfi; zh-classical; testwiki; nost; pdc; wmil; ti; si; ii; wmam; wuu; fi; hyw; li; wm2008; dtp; wmph; bh; ch; wikisource; wmtr; bugzilla; rup; wikimedia; ceb; pwn; sh; tly; tum; wmmk; vec; wikilivres; wikivoyage; atj; pih; bpy; bg; lg; metawiki; ng; mg; ig; tg; sg; wikisophia; wmbd; pap; za; gcr; shi; foundation; ff; wmromd; af; otrswiki; kbp; wmcn; lexemes; sulutil; ckb; mnw; commons; advisory; ee; wmve; ce; be; nds-nl; wmbr; ne; ie; he; ve; te; mwl; wg; oldwikisource; id; gd; usability; testwikidata; gitlab; dty; is; ks; ms; trv; ps; ss; wikipediawikipedia; pnb; ur; spcom; gpe; as; bat-smg; bs; listarchive; fr; hr; kr; mr; or; sgs; sr; wm2018; crh; wmec; smn; ar; gom; cr; wmnl; stats; nds; lmo; sq; arz; diffblog; ary; wm2012; be-tarask; fon; vep; wiktionary; ticket; mailarchive; mediawikiwiki; wmge; bo; foundationsite; nso; wm2013; wmin; wmrs; als; roa-tara; pnt; to; so; no; mo; tpi; eml; io; lo; outreachwiki; fo; eo; ho; an; csb; rev; anp; dsb; yi; hsb; vi; inh; rn; wmpl; tn; mn; nn; gutenbergwiki; vro; kn; ln; en; gn; wmdoc; nqo; wm2006; bm; am; mhr; got; botwiki; wmee; sm; rm; nrm; wmuk; om; km; arc; mni; wmse; nov; ltg; donate; vo; new; sl; wmmx; sep11; chr; pl; ml; nl; kl; gl; el; igl; shn; egl; incubator; wikiversity; zh-cn; uz; chapter; wmbe; cbk-zam; cz; dz; hz; awa; zu; wmhk; tyvawiki; az; hif; gor; my; yue; ky; voy; v; guc; n; wmnyc; wikt; cmn; cy; es; zh-tw; hy; rcirc; fy; olo; nostalgia; wikibooks; ircrc; ay; jp; wmke; szy; vrts; epo; pam; os; mrj; lfn; hi; schoolswp; ksh; mad; vls; wmar; zh; zgh; zea; cs; mh; ady; yo; pfl; srn; xmf; mai; wmpunjabi; frp; wo; war; sn; br; ilo; de; hak; aa; be-x-old; rue; da; ka; ia; ami; ug; udm; tyv; wm2007; labsconsole; ty; tw; btm; co; ts; tr; rw; szl; lld; kw; tl; mw; lrc; th; tet; tcy; sv; tay; ro; wm2016; etherpad; sw; wikinvest; gerrit; phab; alt; wmca; bn; gv; su; download; wmau; cv; dv; pi; roa-rup; se; skr; freenode; nia; kv; species; wmf; nv; wikimania; din; wmco; sharemap; meta; simple; diq; wikiquote; min; wmid; av; jv; quality; wikipedia; sd; pms; outreach; toolhub; hu; gu; wmhi; eu; wmfblog; cu; azb; wm2009; kg; iu; ru; bbc; gsw; ku; rmy; qu; wm2017; wm2011; bug; zh-yue; st; tt; git; avk; pyrev; krc; frr; wm2014; lt; ny; it; otrs; fj; ht; et; strategy; dga; nap; mzn; rt; wikifunctions; pt; ang; wm2015; bjn; wmua; mt; cho; mi; map-bms; fur; gur; lv; wmpt; ko; ki; guw; metawikipedia; wmpa-us; wmru; dbdump; bew
local p = {}
function p._current()
out = {}
for k, v in pairs(mw.site.interwikiMap("local")) do
if v.isCurrentWiki then
table.insert(out, k)
end
end
return out
end
function p._map(isLocal)
isLocal = isLocal and "local" or nil
out = {}
for k, v in pairs(mw.site.interwikiMap(isLocal)) do
table.insert(out, k)
end
return out
end
function p._isCurrentIW(title)
for _, v in ipairs(p._current()) do
pattern = "^:?" .. v .. ":"
if mw.ustring.match(title, pattern) then
return true
end
end
return false
end
function p._isValidIW(title, isLocal)
for _, v in ipairs(p._map(isLocal)) do
pattern = "^:?" .. v .. ":"
if mw.ustring.match(title, pattern) then
return true
end
end
return false
end
local function current(args)
return table.concat(p._current(), (args.sep or ", "))
end
local function map(args)
return table.concat(p._map(args"local"]), (args.sep or ", "))
end
local function isCurrentIW(args)
return p._isCurrentIW((args1 or ""))
end
local function ifCurrentIW(args)
if p._isCurrentIW((args1 or "")) then
return args2 or ""
else
return args3 or ""
end
end
local function isValidIW(args)
return p._isValidIW((args1 or ""), args"local"])
end
local function ifValidIW(args)
if p._isValidIW((args1 or ""), args"local"]) then
return args2 or ""
else
return args3 or ""
end
end
local function makeWrapper(func)
return function (frame)
-- If called via #invoke, use the args passed into the invoking template.
-- Otherwise, for testing purposes, assume args are being passed directly in.
local origArgs
if frame == mw.getCurrentFrame() then
origArgs = frame:getParent().args
for k, v in pairs(frame.args) do
origArgs = frame.args
break
end
else
origArgs = frame
end
-- Strip whitespace, and treat blank arguments as nil.
-- 'sep' has different behaviour depending on whether
-- it is blank or nil, so keep it as it is.
-- isLocal needs to be converted from a string to a bool.
local args = {}
for k, v in pairs(origArgs) do
v = mw.text.trim(v)
if v ~= '' or k == 'sep' then
if k == 'local' then
t = {["true"=true,["false"=false}
argsk = (tv or v==true)
else
argsk = v
end
end
end
return func(args)
end
end
return {
current = makeWrapper(current),
map = makeWrapper(map),
isCurrentIW = makeWrapper(isCurrentIW),
ifCurrentIW = makeWrapper(ifCurrentIW),
isValidIW = makeWrapper(isValidIW),
ifValidIW = makeWrapper(ifValidIW)
}