45,647
edits
No edit summary |
No edit summary |
||
Line 33: | Line 33: | ||
if terminfo.term ~= "-" then | if terminfo.term ~= "-" then | ||
link = " " .. require("Module:links").full_link(terminfo, "term_i", true) | |||
link = " " .. require("Module:links").full_link(terminfo, " | |||
end | end | ||
Line 65: | Line 64: | ||
else | else | ||
info.display = source:makeWikipediaLink() | info.display = source:makeWikipediaLink() | ||
info.cat_name = source: | |||
if source:getType() == "family" then | |||
info.cat_name = source:getCategoryName() | |||
else | |||
info.cat_name = source:getCanonicalName() | |||
end | |||
end | end | ||
Line 107: | Line 111: | ||
end | end | ||
-- Internal implementation of {{inherited|...}} template | -- Internal implementation of {{inherited|...}} template | ||
Line 136: | Line 117: | ||
terminfo = termError(terminfo) | terminfo = termError(terminfo) | ||
terminfo.lang = export.getNonEtymological(terminfo.lang) | terminfo.lang = export.getNonEtymological(terminfo.lang) | ||
if not hasAncestor( | if not lang:hasAncestor(terminfo.lang) and mw.title.getCurrentTitle().nsText ~= "Template" then | ||
local function showLanguage(lang) | local function showLanguage(lang) | ||
return ("[[:Category:%s|%s]] (%s)") | |||
:format(lang:getCategoryName(), lang:getCanonicalName(), lang:getCode()) | |||
end | end | ||
local postscript | local postscript | ||
Line 169: | Line 143: | ||
end | end | ||
error(("%s is not set as an ancestor of %s in %s. %s") | error(("%s is not set as an ancestor of %s in %s. %s") | ||
:format(showLanguage( | :format(showLanguage(terminfo.lang), showLanguage(lang), moduleLink, postscript)) | ||
end | end | ||
Line 195: | Line 169: | ||
if lang:getCode() == source:getCode() then | if lang:getCode() == source:getCode() then | ||
table.insert(categories, lang:getCanonicalName() .. " twice-borrowed terms") | table.insert(categories, lang:getCanonicalName() .. " twice-borrowed terms") | ||
elseif source:getType() == "family" then | |||
table.insert(categories, lang:getCanonicalName() .. " terms borrowed from " .. source:getCategoryName()) | |||
else | else | ||
table.insert(categories, lang:getCanonicalName() .. " terms borrowed from " .. source: | table.insert(categories, lang:getCanonicalName() .. " terms borrowed from " .. source:getCanonicalName()) | ||
end | end | ||
Line 205: | Line 181: | ||
text = "[[semi-learned borrowing|" .. (nocap and "s" or "S") .. "emi-learned borrowing]] from " | text = "[[semi-learned borrowing|" .. (nocap and "s" or "S") .. "emi-learned borrowing]] from " | ||
elseif borrowing_type == "orthographic" then | elseif borrowing_type == "orthographic" then | ||
text = "[[ | text = "[[orthographic|" .. (nocap and "o" or "O") .. "rthographic]] [[Appendix:Glossary#borrowing|borrowing]] from " | ||
elseif borrowing_type == "unadapted" then | elseif borrowing_type == "unadapted" then | ||
text = "[[Appendix:Glossary#unadapted borrowing|" .. (nocap and "u" or "U") .. "nadapted borrowing]] from " | text = "[[Appendix:Glossary#unadapted borrowing|" .. (nocap and "u" or "U") .. "nadapted borrowing]] from " | ||
Line 216: | Line 192: | ||
-- For non-plain borrowings, insert extra category, unless lang and source | -- For non-plain borrowings, insert extra category, unless lang and source | ||
-- are the same (a twice-borrowed term). | -- are the same (a twice-borrowed term). | ||
table.insert(categories, lang:getCanonicalName() .. " " .. borrowing_type .. " borrowings from " .. | local source_name = source:getType() == "family" and source:getCategoryName() or source:getCanonicalName() | ||
table.insert(categories, lang:getCanonicalName() .. " " .. borrowing_type .. " borrowings from " .. source_name) | |||
end | end | ||
Line 237: | Line 213: | ||
local categories = {} | local categories = {} | ||
category = category:gsub("SOURCE", source: | if source:getType() == "family" then | ||
category = category:gsub("SOURCE", source:getCategoryName()) | |||
else | |||
category = category:gsub("SOURCE", source:getCanonicalName()) | |||
end | |||
table.insert(categories, lang:getCanonicalName() .. " " .. category) | table.insert(categories, lang:getCanonicalName() .. " " .. category) | ||
local link = createLink(terminfo, template_name) | local link = createLink(terminfo, template_name) | ||
result = result .. export.format_etyl(lang, source, sort_key, categories, nocat) .. link | result = result .. " " .. export.format_etyl(lang, source, sort_key, categories, nocat) .. link | ||
return result | return result | ||
Line 274: | Line 254: | ||
-- Internal implementation of {{semantic loan|...}} template | -- Internal implementation of {{semantic loan|...}} template | ||
function export.semantic_loan(lang, terminfo, sort_key, nocap, notext, nocat) | function export.semantic_loan(lang, terminfo, sort_key, nocap, notext, nocat) | ||
local pre_text = "" | local pre_text = "" | ||
Line 286: | Line 265: | ||
-- Internal implementation of {{phono-semantic matching|...}} template | -- Internal implementation of {{phono-semantic matching|...}} template | ||
function export.phono_semantic_matching(lang, terminfo, sort_key, nocap, notext, nocat) | function export.phono_semantic_matching(lang, terminfo, sort_key, nocap, notext, nocat) | ||
local pre_text = "" | local pre_text = "" | ||