VOOZH about

URL: https://minecraft.wiki/w/Module:Language_link

⇱ Module:Language link – Minecraft Wiki


Module:Language link

From Minecraft Wiki
Jump to navigation Jump to search
Documentation[view] [edit] [history] [purge]Jump to code ↴

Module version of {{Language link}} allowing easy linking in modules for translation projects.

localll=require('Module:Language link').main

-- Parameters
ll('Link (Required)','Text (Optional)','Plain (Optional)')

-- Examples
ll('Zombi')--> [[Minecraft Wiki:Projects/Finnish translation/Zombi|Zombi]]

ll('Zombi','Zombit')--> [[Minecraft Wiki:Projects/Finnish translation/Zombi|Zombit]]

ll('Zombi','',true)--> Minecraft Wiki:Projects/Finnish translation/Zombi
[view] [edit] [history] [purge]The above documentation is transcluded from Module:Language link/doc.
require('strict')
localp={}
localtitle=mw.title.getCurrentTitle()
localnamespace=mw.site.namespaces.Project.name
functionp.main(link,text,plain)
assert(link,"bad argument #1 for 'link' (string expected, got nil)")
localdisplay=textandtextorlink
localpage=title.baseText
:gsub('^Projects/','')
localsubpage=string.find(page,'/')
ifsubpagethen
page=string.sub(page,1,subpage-1)
end
link=link:gsub("^%l",string.upper)
ifplainthen
returnstring.format('%s:Projects/%s/%s',namespace,page,link)
end
returnstring.format('[[%s:Projects/%s/%s|%s]]',namespace,page,link,display)
end
returnp
Retrieved from "https://minecraft.wiki/w/Module:Language_link?oldid=3258879"

Navigation menu