Module:links: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 11: Line 11:
[[Module:languages]] and its submodules
[[Module:languages]] and its submodules
[[Module:gender and number]]
[[Module:gender and number]]
[[Module:debug/track]]
]=]
]=]
local m_str_utils = require("Module:string utilities")
local m_str_utils = require("Module:string utilities")
Line 36: Line 35:
local u = m_str_utils.char
local u = m_str_utils.char
local TEMP_UNDERSCORE = u(0xFFF0)
local TEMP_UNDERSCORE = u(0xFFF0)
local function track(page, code)
local tracking_page = "links/" .. page
if code then
require("Module:debug/track"){tracking_page, tracking_page .. "/" .. code}
else
require("Module:debug/track")(tracking_page)
end
return true
end


do
do
Line 307: Line 296:
if prefix ~= "category" and not (prefix and mw.loadData("Module:data/interwikis")[prefix]) then
if prefix ~= "category" and not (prefix and mw.loadData("Module:data/interwikis")[prefix]) then
if (link.fragment or link.target:find("#$")) and not plain then
if (link.fragment or link.target:find("#$")) and not plain then
track("fragment", lang:getFullCode())
if cats then
if cats then
insert(cats, lang:getFullName() .. " links with manual fragments")
insert(cats, lang:getFullName() .. " links with manual fragments")
Line 384: Line 372:


if data.alt then
if data.alt then
track("alt-ignored")
mw.log("(from Module:links)", "text with embedded wikilinks:", text,
mw.log("(from Module:links)", "text with embedded wikilinks:", text,
"ignored alt:", data.alt, "lang:", data.lang:getFullCode())
"ignored alt:", data.alt, "lang:", data.lang:getFullCode())
Line 393: Line 380:
if data.id then
if data.id then
track("id-ignored")
mw.log("(from Module:links)", "text with embedded wikilinks:", text,
mw.log("(from Module:links)", "text with embedded wikilinks:", text,
"ignored id:", data.id, "lang:", data.lang:getFullCode())
"ignored id:", data.id, "lang:", data.lang:getFullCode())
Line 970: Line 956:
-- aren't sufficient because they only work with reference to automatic translit and won't operate at all in
-- aren't sufficient because they only work with reference to automatic translit and won't operate at all in
-- languages without any automatic translit, like Persian and Hebrew.
-- languages without any automatic translit, like Persian and Hebrew.
if data.tr[1] then
track("manual-tr", data.lang:getFullCode())
end


-- Try to generate a transliteration, unless transliteration has been supplied and data.no_check_redundant_translit is
-- Try to generate a transliteration, unless transliteration has been supplied and data.no_check_redundant_translit is