Module:etymology: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 5: Line 5:


local function term_error(terminfo)
local function term_error(terminfo)
if terminfo.lang:hasType("family") then
if terminfo.lang then
if terminfo.term and terminfo.term ~= "-" then
if terminfo.lang:hasType("family") then
require("Module:debug/track")("etymology/family/has-term")
terminfo.term = "-"
end
end
terminfo.term = "-"
end
end
return terminfo
return terminfo
Line 19: Line 17:
local link = ""
local link = ""
if terminfo.term == "-" then
if terminfo.term ~= "-" then
--[=[
[[Special:WhatLinksHere/Wiktionary:Tracking/cognate/no-term]]
[[Special:WhatLinksHere/Wiktionary:Tracking/derived/no-term]]
[[Special:WhatLinksHere/Wiktionary:Tracking/borrowed/no-term]]
[[Special:WhatLinksHere/Wiktionary:Tracking/calque/no-term]]
]=]
require("Module:debug/track")(template_name .. "/no-term")
else
-- mw.log(terminfo.term)
-- mw.log(terminfo.term)
link = require("Module:links").full_link(terminfo, "term")
link = require("Module:links").full_link(terminfo, "term")
Line 79: Line 69:
table.insert(categories, langname .. " terms borrowed back into " .. langname)
table.insert(categories, langname .. " terms borrowed back into " .. langname)
else
else
table.insert(categories, langname .. " " .. (data.borrowing_type or "terms derived") .. " from " ..
table.insert(categories, langname .. " terms derived from " .. cat_name)
cat_name)
if data.borrowing_type then
table.insert(categories, langname .. " terms " .. data.borrowing_type .. " from " .. cat_name)
end
end
end
end
end
Line 90: Line 82:
function export.format_source(data)
function export.format_source(data)
local lang, sort_key = data.lang, data.sort_key
local lang, sort_key = data.lang, data.sort_key
-- [[Special:WhatLinksHere/Wiktionary:Tracking/etymology/sortkey]]
if sort_key then
require("Module:debug/track")("etymology/sortkey")
end


local display, categories = export.insert_source_cat_get_display(data)
local display, categories = export.insert_source_cat_get_display(data)

Navigation menu