Jump to content
Toggle menu
  • 3 articles
  • 75 files
  • 7 users
  • 37.9K edits
Neodyland Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Module:TNT: Difference between revisions

From Neodyland Wiki
m Copying 3 changes by Yurik,Krinkle: "fixed doc link, Try ucfirst to bypass some unknown cache" from mw:Module:TNT
m Copying 4 changes by Yurik: "docs link, add language param, better description, more docs changes" from mw:Module:TNT. See docs.
Line 4: Line 4:
--    wikis without any translation changes. All translation text is stored
--    wikis without any translation changes. All translation text is stored
--    in the global  Data:*.tab  pages on Commons, and used everywhere.
--    in the global  Data:*.tab  pages on Commons, and used everywhere.
--
-- SEE:  https://www.mediawiki.org/wiki/Multilingual_Templates_and_Modules
--
--
-- ATTENTION:
-- ATTENTION:
Line 41: Line 43:
for k, v in pairs(frame.args) do
for k, v in pairs(frame.args) do
if k == 1 then
if k == 1 then
dataset = v
dataset = mw.text.trim(v)
elseif k == 2 then
elseif k == 2 then
id = v
id = mw.text.trim(v)
elseif type(k) == 'number' then
elseif type(k) == 'number' then
table.insert(params, v)
table.insert(params, v)
elseif k == 'lang' and v ~= '_' then
elseif k == 'lang' and v ~= '_' then
lang = v
lang = mw.text.trim(v)
end
end
end
end
Line 61: Line 63:
-- 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
function link(dataset)
function link(dataset)
dataset = 'Data:' .. (dataset or '')
dataset = 'Data:' .. mw.text.trim(dataset or '')
if mw.site.siteName == 'Wikimedia Commons' then
if mw.site.siteName == 'Wikimedia Commons' then
return dataset
return dataset
Cookies help us deliver our services. By using our services, you agree to our use of cookies.