Module:TNT: Difference between revisions

130 bytes removed ,  5 years ago
deprecate link function, always use c: for data links to Commons
(copying from mediawiki. Please allow my bot to do it instead - see mw:WP:TNT. Thanks!)
(deprecate link function, always use c: for data links to Commons)
Line 68:
end
 
-- Obsolete function that adds a 'c:' prefix to the first param.
-- Converts first parameter to a interwiki-ready link. For example, it converts
-- "Sandbox/Sample.tab" -> 'commonsc:Data:Sandbox/Sample.tab'
function p.link(frame)
return link(frame.args[1])
Line 158:
-- Given a dataset name, convert it to a title with the 'commons:data:' prefix
link = function(dataset)
dataset =return 'c:Data:' .. mw.text.trim(dataset or '')
if mw.site.siteName == 'Wikimedia Commons' then
return dataset
else
return 'commons:' .. dataset
end
end
 
Anonymous user