Module:links: Difference between revisions

No edit summary
No edit summary
Line 377: Line 377:
-- Link to appendix for reconstructed terms and terms in appendix-only languages. Plain links interpret *
-- Link to appendix for reconstructed terms and terms in appendix-only languages. Plain links interpret *
-- literally, however.
-- literally, however.
if reconstructed == 1 then
if not lang:hasType("conlang") then
if lang:getFullCode() == "und" then
if lang:hasType("appendix-constructed") then
-- Return the original target as default display value. If we don't do this, we wrongly get
target = "wikt:Appendix:" .. lang:getFullName() .. "/" .. target
-- [Term?] displayed instead.
elseif reconstructed == 1 then -- asterisk found
return nil, orig_target
if lang:getFullCode() == "und" then
-- Return the original target as default display value. If we don't do this, we wrongly get
-- [Term?] displayed instead.
return nil, orig_target
end
target = "wikt:Reconstruction:" .. lang:getFullName() .. "/" .. target
elseif anti_asterisk ~= 1 and (lang:hasType("reconstructed") or lang:getFamilyCode() == "qfa-sub") then
error("The specified language " .. lang:getCanonicalName()
.. " is unattested, while the given term does not begin with '*' to indicate that it is reconstructed.")
else
target = target
end
end
if not lang:hasType("conlang") then
target = "Reconstruction:" .. lang:getFullName() .. "/" .. target
end
-- Reconstructed languages and substrates require an initial *.
elseif anti_asterisk ~= 1 and (lang:hasType("reconstructed") or lang:getFamilyCode() == "qfa-sub") then
target = "*" .. target
elseif lang:hasType("appendix-constructed") then
target = "Appendix:" .. lang:getFullName() .. "/" .. target
else
else
target = target
target = "Contionary:" .. target
end
end
target = (lang:hasType("conlang") and "Contionary:" or "wikt:") .. target
return target, orig_target, escaped > 0
return target, orig_target, escaped > 0