"साचा:Fallback" च्या विविध आवृत्यांमधील फरक
Content deleted Content added
Steinsplitter (चर्चा | योगदान) restoring cosmetic changes |
Steinsplitter (चर्चा | योगदान) restoring o change |
||
ओळ ८१:
end
function p.autotranslate(frame) -- logic for [[template:Autotranslate]]
local args = frame.args
if not args.lang or args.lang == '' then
args.lang = frame:preprocess( "{{int:lang}}" ) -- get user's chosen language
end
local page = p.fallbackpage('Template:' .. args.base, args.lang)▼
if not base or base == '' then
return '<strong class="error">Base page not provided for autotranslate</strong>'
end
if string.sub(base,2,9) ~= 'emplate:' then
base = 'Template:' .. base -- base provided without 'Template:' part
end
-- find base template language subpage
if (not page and base ~= args.base) then
-- try the original args.base string. This case is only needed if base is not in template namespace
page = p.fallbackpage(args.base, args.lang)
end
if not page then
return string.format('<strong class="error">no fallback page found for autotranslate (base=[[%s]], lang=%s)</strong>', args.base, args.lang)
end
-- repack args in a standard table
newargs = {}
for
if
end
end
local maintext = frame:expandTemplate{ title = page, args = newargs }▼
-- Transclude {{page |....}} with template arguments the same as the ones passed to {{autotranslate}} template.
end
|