Module:links: Difference between revisions

Jump to navigation Jump to search
889 bytes removed ,  13 August 2024
no edit summary
No edit summary
No edit summary
Line 250: Line 250:
-- If they're different, but the alt text could have been entered as the term parameter without it affecting the target page, then the target parameter is redundant (e.g. {{l|ru|фу|фу́}}).
-- If they're different, but the alt text could have been entered as the term parameter without it affecting the target page, then the target parameter is redundant (e.g. {{l|ru|фу|фу́}}).
-- If `no_alt_ast` is true, use pcall to catch the error which will be thrown if this is a reconstructed lang and the alt text doesn't have *.
-- If `no_alt_ast` is true, use pcall to catch the error which will be thrown if this is a reconstructed lang and the alt text doesn't have *.
if link.display == auto_display then
if link.display ~= auto_display then
insert(cats, lang:getCanonicalName() .. " links with redundant alt parameters")
else
local ok, check
local ok, check
if no_alt_ast then
if no_alt_ast then
Line 259: Line 257:
ok = true
ok = true
check = export.get_link_page(orig_display, lang, sc, plain)
check = export.get_link_page(orig_display, lang, sc, plain)
end
if ok and link.target == check then
insert(cats, lang:getCanonicalName() .. " links with redundant target parameters")
end
end
end
end
Line 452: Line 447:
end
end
data.term, data.alt = term, pipe and pipe ~= #text and sub(text, pipe + 1) or nil
data.term, data.alt = term, pipe and pipe ~= #text and sub(text, pipe + 1) or nil
if data.cats then
insert(data.cats, data.lang:getCanonicalName() .. " links with redundant wikilinks")
end
end
end


Line 973: Line 965:
if automated_tr or data.tr_fail then
if automated_tr or data.tr_fail then
local manual_tr = data.tr[1]
local manual_tr = data.tr[1]
if manual_tr then
if (export.remove_links(manual_tr) == export.remove_links(automated_tr)) and (not data.tr_fail) then
insert(data.cats, data.lang:getCanonicalName() .. " terms with redundant transliterations")
elseif not data.tr_fail then
-- Prevents Arabic root categories from flooding the tracking categories.
if mw.title.getCurrentTitle().nsText ~= "Category" then
insert(data.cats, data.lang:getCanonicalName() .. " terms with non-redundant manual transliterations")
end
end
end
if (not manual_tr) or data.lang:overrideManualTranslit(data.sc[1]) then
if (not manual_tr) or data.lang:overrideManualTranslit(data.sc[1]) then

Navigation menu