Module:links: Difference between revisions

no edit summary
(Undo revision 309932 by Sware (talk))
Tag: Undo
No edit summary
 
(12 intermediate revisions by the same user not shown)
Line 113: Line 113:
end
end
end
end
 
-- Process the target
-- Process the target
link.target = link.target:gsub("^%*", "Reconstruction:" .. lang:getCanonicalName() .. "/")
link.target = link.nocont and link.target:gsub("^%*", "Reconstruction:" .. lang:getCanonicalName() .. "/") or link.target
link.target = export.getLinkPage(link.target, lang)
link.target = export.getLinkPage(link.target, lang)


Line 371: Line 371:


-- Is there any text to show?
-- Is there any text to show?
if (data.term or data.alt) then
if (data.term or data.alt) and data.term ~= "-" then
-- Try to detect the script if it was not provided
-- Try to detect the script if it was not provided
if not data.sc then
if not data.sc then
Line 416: Line 416:
Is there at least a transliteration we can work from? ]]
Is there at least a transliteration we can work from? ]]
link = require("Module:script utilities").request_script(data.lang, data.sc)
link = require("Module:script utilities").request_script(data.lang, data.sc)
 
if link == "" or not data.tr or data.tr == "-" then
if not data.sc then
data.sc = require("Module:scripts").findBestScript(data.alt or data.term, data.lang)
else
-- Track uses of sc parameter
local best = require("Module:scripts").findBestScript(data.alt or data.term, data.lang)
end
if link == "" or link == "-" or link == "?" or not data.tr or data.tr == "-" then
-- No link to show, and no transliteration either. Show a term request.
-- No link to show, and no transliteration either. Show a term request.
local category = ""
local category = ""