Difference between revisions 18626591 and 18626592 on frwiktionarylocal export = {} -- Detect the script based on the first alphabetical characters of a string function export.detect_script(text, lang) local m_scripts = mw.loadData("Module:scripts/tempdata") local scripts = mw.loadData("Module:languages/alldata")[lang:getCode()].scripts local scFix = false (contracted; show full) -- Used by {{categorize}} function export.template_categorize(frame) NAMESPACE = NAMESPACE or mw.title.getCurrentTitle().nsText local format = frame.args["format"] local args = frame:getParent().args local lang code = args[1]; if langcode == "" then langcode = nil end local sort_key = args["sort"]; if sort_key == "" then sort_key = nil end local categories = {} if not langcode then if NAMESPACE == "Template" then⏎ lang = "u return "" end" else⏎ error("Language code has not been specified. Please pass parameter 1 to the template.") end⏎ end local lang = require("Module:languages").getLanguageByCode(lang)code) if not lang then if NAMESPACE == "Template" then return "" end error("The language code \"" .. langcode .. "\" is not valid.") end local prefix = "" if format == "pos" then prefix = lang:getCanonicalName() .. " " elseif format == "topic" then prefix = lang:getCode() .. ":" end local i = 2 local cat = args[i] while cat do if cat ~= "" then table.insert(categories, prefix .. cat) end i = i + 1 cat = args[i] end return export.format_categories(categories, lang, sort_key) 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=18626592.
![]() ![]() 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.
|