Difference between revisions 18626593 and 18626594 on frwiktionarylocal export = {} -- Detect the script based on the characters of a string function export.detect_script(text, lang) local scripts = lang:getScripts() -- Try to match every script against the text, -- and return the one with the most matching characters. local bestcount = 0 local bestscript = nil for i, script in ipairs(scripts) do local count = script:countCharacters(text) if count > bestcount then bestcount = count bestscript = script end end if bestscript then -- TODO: return the object itself, not the code return bestscript:getCode() end -- No matching script was found. Return "None". return "None" --require("Module:scripts").getScriptByCode("None"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 (contracted; show full) 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=18626594.
![]() ![]() 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.
|