Changes
finish i18n
cfg.sandboxSubpage = 'sandbox' -- The name of the template subpage typically used for sandboxes.
cfg.testcasesSubpage = 'testcases' -- The name of the template subpage typically used for test cases.
cfg.printSubpage = 'Print' -- The name of the template subpage used for print versions.
cfg.mainDivId = 'template-documentation' -- The "id" attribute of the main HTML "div" tag.
cfg.mainDivClasses = 'template-documentation iezoomfix' -- The CSS classes added to the main HTML "div" tag.
cfg.testcasesEditLinkDisplay = 'edit' -- The text to display for test cases "edit" links.
cfg.testcasesCreateLinkDisplay = 'create' -- The text to display for test cases "create" links.
cfg.docLinkDisplay = '/' .. cfg.docSubpage -- The text to display when linking to the /doc subpage.
cfg.subpagesLinkDisplay = 'Subpages of this $1' -- The text to display for the "subpages of this page" link. $1 is cfg.templatePagetype, cfg.modulePagetype or cfg.defaultPagetype, depending on whether the current page is in the template namespace, the module namespace, or another namespace.
cfg.printLinkDisplay = '/' .. cfg.printSubpage -- The text to display when linking to the /doc subpage.
-- Sentences used in the end box.
cfg.templatePossessive = "template's" -- Possessive case for "template".
cfg.modulePossessive = "module's" -- Possessive case for "module".
cfg.mirrorEditSummary = 'Create sandbox version of $1' -- The default edit summary to use when a user clicks the "mirror" link. $1 is a wikilink to the template page.cfg.experimentBlurb = 'Editors can experiment in this $1 $2 and $3 pages.' -- Text inviting editors to experiment in sandbox and test cases pages. It is only shown in the template and module namespaces. $1 is cfg.templatePossessive or cfg.modulePossessive depending on what namespace we are in. $2 is a link to the sandbox in the format "cfg.sandboxLinkDisplay (cfg.sandboxEditLinkDisplay | cfg.compareLinkDisplay)" if the sandbox exists, and the format "cfg.sandboxLinkDisplay (cfg.sandboxCreateLinkDisplay | cfg.mirrorLinkDisplay)" if the sandbox doesn't exist. If the sandbox link doesn't exist, the create link preloads the page with cfg.templateSandboxPreload or cfg.moduleSandboxPreload depending on the current namespace. If the page doesn't exist, the mirror link uses the edit summar cfg.mirrorEditSummary. $3 is a link to the test cases page in the format "cfg.testcasesLinkDisplay (cfg.testcasesEditLinkDisplay)" if the test cases page exists, and in the format "cfg.testcasesLinkDisplay (cfg.testcasesCreateLinkDisplay)" if the test cases page doesn't exist. If the test cases page doesn't exist, the create link preloads the page with cfg.templateTestcasesPreload or cfg.moduleTestcasesPreload depending on the current namespace.cfg.addCategoriesBlurb = 'Please add categories to the $1 subpage.' -- Text to direct users to add categories to the /doc subpage. Not used if the "content" or "docname fed" arguments are set, as then it is not clear where to add the categories. $1 is a link to the /doc subpage with a display value of cfg.docLinkDisplay.cfg.printBlurb = 'A [[Help:Books/for experts#Improving the book layout|print version]] of this template exists at $1. If you make a change to this template, please update the print version as well.' -- Text to display if a /Print subpage exists. $1 is a link to the subpage with a display value of cfg.printLinkDisplay.
-- Other display settings
cfg.fileNamespaceHeading = 'Summary' -- The heading shown in the file namespace.
cfg.otherNamespacesHeading = 'Documentation' -- The heading shown in other namespaces.
cfg.templatePagetype = 'template' -- The pagetype to display for template pages.
cfg.modulePagetype = 'module' -- The pagetype to display for Lua module pages.
cfg.defaultPagetype = 'page' -- The pagetype to display for pages other than templates or Lua modules.
-- Category settings
cfg.displayPrintCategory = true -- Set to true to enable output of cfg.printCategory if a /Print subpage exists.
cfg.printCategory = 'Templates with print versions' -- Category to output if cfg.displayPrintCategory is set to true, and a /Print subpage exists.
cfg.displayStrangeUsageCategory = true -- Set to true to enable output of cfg.strangeUsageCategory if the module is used on a /doc subpage or a /testcases subpage.
cfg.strangeUsageCategory = 'Wikipedia pages with strange ((documentation)) usage' -- Category to output if cfg.displayStrangeUsageCategory is set to true and the module is used on a /doc subpage or a /testcases subpage.
cfg.strangeUsageCategoryMainspaceSort = 'Main:' -- Category sort key prefix to use for cfg.strangeUsageCategory in the main namespace. The prefix is followed by the full page name.
----------------------------------------------------------------------------
return mw.ustring.format('[[%s]]', page)
end
end
local function makeCategoryLink(cat, sort)
local catns = mw.site.namespaces[14].name
return makeWikilink(catns .. '/' .. cat, sort)
end
local sandboxPreload = subjectSpace == 828 and cfg.moduleSandboxPreload or cfg.templateSandboxPreload
local sandboxCreateLink = makeUrlLink(sandboxTitle:fullUrl{action = 'edit', preload = sandboxPreload}, cfg.sandboxCreateLinkDisplay)
local mirrorSummary = 'Create sandbox version of ' .formatMessage(cfg. mirrorEditSummary, {makeWikilink(templatePage)})
local mirrorLink = makeUrlLink(sandboxTitle:fullUrl{action = 'edit', preload = templatePage, summary = mirrorSummary}, cfg.mirrorLinkDisplay)
sandboxLinks = cfg.sandboxLinkDisplay .. ' ' .. makeToolbar(sandboxCreateLink, mirrorLink)
-- Show the categories text, but not if "content" fed or "docname fed" since then it is unclear where to add the categories.
if not content and not docnameFed then
end
-- Show the "subpages" link.
local pagetype
if subjectSpace == 10 then
pagetype = 'template'cfg.templatePagetype
elseif subjectSpace == 828 then
pagetype = 'module'cfg.modulePagetype
else
pagetype = 'page'cfg.defaultPagetype
end
text = text .. ' ' .. makeWikilink('Special:PrefixIndex/' .. templatePage .. '/', 'Subpages of this ' .formatMessage(cfg. subpagesLinkDisplay, {pagetype}))
end
-- Show the "print" link if it exists.
local printPage = templatePage .. '/Print'.. cfg.printSubpage
local printTitle = mw.title.new(printPage)
if printTitle.exists then
local printLink = makeWikilink(printPage, cfg.printLinkDisplay) text = text .. '<br />A [[Help:Books/for experts#Improving the book layout|print version]] of this template exists at ' .. makeWikilinkformatMessage(printPagecfg.printBlurb, '/Print'{printLink}) .. '(cfg. If you make a change to this template, please update the print version as welldisplayPrintCategory and makeCategoryLink(cfg.printCategory) or ' .. '[[Category:Templates with print versions]]')
end
end
local ret = ''
local subpage = currentTitle.subpageText
if cfg.displayStrangeUsageCategory and (subpage == cfg.docSubpage or subpage == cfg.testcasesSubpage ) then local sort = (currentTitle.namespace == 0 and 'Main:' cfg.strangeUsageCategoryMainspaceSort or '') .. currentTitle.prefixedText -- Sort on namespace. ret = ret .. makeWikilinkmakeCategoryLink('Category:Wikipedia pages with strange ((documentation)) usage'cfg.strangeUsageCategory, sort)
end
return ret