Difference between revisions 18626595 and 18626596 on frwiktionarylocal export = {} -- Detect the script based on the characters of a string function export.detect_script(text, lang) require("Module:debug").track("detect_script") return require("Module:scripts").findBestScript(text, lang):getCode() end -- Format the categories with the appropriate sort key function export.format_categories(categories, lang, sort_key, sort_base) NAMESPACE = NAMESPACE or mw.title.getCurrentTitle().nsText if NAMESPACE == "" or NAMESPACE == "Appendix" then PAGENAME = PAGENAME or mw.title.getCurrentTitle().text SUBPAGENAME = SUBPAGENAME or mw.title.getCurrentTitle().subpageText if not lang then lang = require("Module:languages").getLanguageByCode("und") end -- Generate a default sort key sort_base = lang:makeSortKey(sort_base or SUBPAGENAME) if sort_key then -- Gather some statistics regarding sort keys (contracted; show full) local categories = {} if not langcode then if NAMESPACE == "Template" then return "" end error("Language code has not been specified. Please pass parameter 1 to the template.") end local lang = require("Module:languages").get LanguageByCode(langcode) 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=18626596.
![]() ![]() 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.
|