Difference between revisions of "Module:Template translation"
Jump to navigation
Jump to search
m
arguments still need to be copied (they are not a proper table)
en>Verdy p m (forward the noshift parameter to avoid infinite recursion) |
en>Verdy p m (arguments still need to be copied (they are not a proper table)) |
||
Line 177: | Line 177: | ||
-- Then render the pagename. | -- Then render the pagename. | ||
local pargs = (frame:getParent() or {}).args | local pargs = (frame:getParent() or {}).args | ||
local arguments | local arguments = {} | ||
if (args['noshift'] or '') == '' | if (args['noshift'] or '') == '' | ||
then | then | ||
for k, v in pairs(pargs) do | for k, v in pairs(pargs) do | ||
-- numbered args >= 1 need to be shifted | -- numbered args >= 1 need to be shifted | ||
Line 196: | Line 195: | ||
else -- special case where TNT is used as autotranslate | else -- special case where TNT is used as autotranslate | ||
-- (don't shift again what is shifted in the invokation) | -- (don't shift again what is shifted in the invokation) | ||
arguments = | for k, v in pairs(pargs) do | ||
arguments[k] = v | |||
end | |||
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 |