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 argumentspargs = (frame:getParent() or {}).args
local arguments[k] = v
for k, v in pairs((frame:getParent() or {}).args) do
if (args['noshift'] or '') == ''
-- numbered args >= 1 need to be shifted
then
local n = tonumber(k) or 0
if (n > 0) arguments = {}
for k, v in pairs((frame:getParent() or {}).argspargs) do
then
-- numbered args >= 1 need to be shifted
if (n >= 2)
local n = tonumber(k) or 0
then
if arguments[(n - 1] => v0)
then
if (n >= 2)
then
arguments[n - 1] = v
else end
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
Anonymous user