Zum Inhalt springen

Modul:TNT: Unterschied zwischen den Versionen

sync from wmw
(copying from mediawiki. Please allow my bot to do it instead - see mw:WP:TNT. Thanks!)
(sync from wmw)
Zeile 68: Zeile 68:
end
end


-- Converts first parameter to a interwiki-ready link. For example, it converts
-- Obsolete function that adds a 'c:' prefix to the first param.
-- "Sandbox/Sample.tab" -> 'commons:Data:Sandbox/Sample.tab'
-- "Sandbox/Sample.tab" -> 'c:Data:Sandbox/Sample.tab'
function p.link(frame)
function p.link(frame)
return link(frame.args[1])
return link(frame.args[1])
Zeile 158: Zeile 158:
-- Given a dataset name, convert it to a title with the 'commons:data:' prefix
-- Given a dataset name, convert it to a title with the 'commons:data:' prefix
link = function(dataset)
link = function(dataset)
dataset = 'Data:' .. mw.text.trim(dataset or '')
return 'c:Data:' .. mw.text.trim(dataset or '')
if mw.site.siteName == 'Wikimedia Commons' then
return dataset
else
return 'commons:' .. dataset
end
end
end


Anonymer Benutzer