Module:headword: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 883: Line 883:
------    otherwise fall back to the overall script if given. If neither given, autodetect the script.
------    otherwise fall back to the overall script if given. If neither given, autodetect the script.


local auto_scs = data.lang:getScripts()
------ 6b. Try to detect the script(s) if not provided. If a per-head script is provided, that takes precedence,
local auto_sc
------    otherwise fall back to the overall script if given. If neither given, autodetect the script.
 
if #auto_scs > 1 then
local auto_sc = data.lang:findBestScript(head.term)
auto_sc = "None"
for _, sc in ipairs(auto_scs) do
if sc == find_best_script_without_lang(head.term):getCode() then
auto_sc = sc
break
end
end
local auto_sc = require("Module:scripts").getByCode(sc)
else
local auto_sc = require("Module:scripts").getByCode(auto_scs[1])
end
if (
if (
auto_sc:getCode() == "None" and
auto_sc:getCode() == "None" and

Navigation menu