Anonymous user
Module:Template translation: Difference between revisions
m
no edit summary
m (catch undocumented exveption thrown by mw.title.new) |
mNo edit summary |
||
Line 172:
-- Copy args pseudo-table to a proper table so we can feed it to expandTemplate.
-- Then render the pagename.
local
for k, v in pairs((frame:getParent() or {}).args) do▼
if (args['noshift'] or '') == ''
-- numbered args >= 1 need to be shifted▼
local n = tonumber(k) or 0▼
▲ then
▲ -- numbered args >= 1 need to be shifted
if (n >= 2)▼
then▼
if
then
arguments[n - 1] = v
else
arguments[k] = v
end
▲ else
▲ arguments[k] = v
end
else -- special case where TNT is used as autotranslate
-- (don't shift again what is shifted in the invokation)
arguments = pargs
end
arguments['template'] = title.prefixedText -- override the existing parameter of the base template name supplied with the full name of the actual template expanded
|