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