Difference between revisions 21306648 and 21306649 on frwiktionarylocal export = {}⏎ local langtemplates = require('Module:languages/templates') -- The main entry point. -- This is the only function that can be invoked from a template. function export.show(frame) if mw.title.getCurrentTitle().nsText == "Template" then return "(This template should be used on pages in the Category: namespace.)" elseif mw.title.getCurrentTitle().nsText ~= "Category" then error("This template/module can only be used on pages in the Category: namespace.") end local args = frame.args -- Get all the parameters and the label data local info = {} for key, val in pairs(args) do info[key] = val; if info[key] == "" then info[key] = nil end end -- autofill parameters for topic cat⏎ if info.template == "topic cat" and not info.code and not info.label then pagename = mw.title.getCurrentTitle().text pagename = mw.text.split(pagename,':') if #pagename == 1 then info.label = pagename[1] elseif #pagename == 2 then info.code = pagename[1] info.label = pagename[2] end end -- autofill parameters for derivcatboiler if info.template == "derivcatboiler" and not info.code and not info.label and mw.title.getCurrentTitle() ~= "Category:Terms derived from other languages" then pagename = mw.title.getCurrentTitle().text pagename = mw.text.split(pagename, ' derived from ') if pagename[1] == "Category:Terms " then info.label = "ROOT" info.code = langtemplates.getByCanonicalName(pagename[2]) else local source = mw.ustring.subs(pagename[1], 10, -7) if pagename[2] == "other languages" then local dest = "ROOT" else local dest = pagename[2] end info.label = langtemplates.getByCanonicalName(dest) info.code = langtemplates.getByCanonicalName(source) end end⏎ ⏎ if not info.template then error("The \"template\" parameter was not specified.") end local template = info.template info.template = nil local current = require("Module:category tree/" .. template).new(info, true) local display = {} (contracted; show full) return mw.getCurrentFrame():expandTemplate{title = TOC_template.text, args = {}} end end return nil end return export All content in the above text box is licensed under the Creative Commons Attribution-ShareAlike license Version 4 and was originally sourced from https://fr.wiktionary.org/w/index.php?diff=prev&oldid=21306649.
![]() ![]() This site is not affiliated with or endorsed in any way by the Wikimedia Foundation or any of its affiliates. In fact, we fucking despise them.
|