Module:Lang: Difference between revisions

Content deleted Content added
sync from sandbox;
sync from sandbox;
Line 41:
 
--[[--------------------------< C O M M O N _ P A R A M S >----------------------------------------------------
 
 
 
]]
 
Line 74 ⟶ 77:
['links'] = true,
['lit'] = true,
['script'] = true, -- deprecated in {{langx}}; will become unique to {{lang-xx}}
['region'] = true, -- deprecated in {{langx}}; will become unique to {{lang-xx}}
['variant'] = true, -- deprecated in {{langx}}; will become unique to {{lang-xx}}
['engvar'] = true,
},
Line 91:
[2] = true, -- alias of |translit=
[3] = true, -- alias of |translation=
['script'] = true, -- deprecatedthese inneeded {{langx}};to willoverride becomedefault uniqueparams toin {{lang-xx??}} templates
['region'] = true,
['variant'] = true,
},
}
Line 1,098 ⟶ 1,101:
end
 
-- msg = parameter_validate (args, templates.lang);
-- if msg then
-- return make_error_msg (msg, args, templates.lang);
-- end
 
msg = validate_text (template, args); -- ensure that |text= is set
Line 1,194 ⟶ 1,197:
end -- end of valueFunc
});
 
args_t.fn = nil; -- unset because not supported but this function might have been called by {{lang|fn=lang|...}}
 
local msg = parameter_validate (args_t, templates.lang); -- verify that all supplied parameters are supported by {{lang-??}}
if msg then
return make_error_msg (msg, args_t, templates.lang); -- when template has unsupported params, abandon with error message
end
 
return _lang (args_t);
Line 1,452 ⟶ 1,462:
table.insert (out, make_category (code, category_name, args.nocat));
if (templates.langx == base_template) and (args.script or args.region or args.variant) then
table.insert (maint_cats, 'Langx deprecated parameters');
table.insert (maint_msgs, '{{langx}} uses deprecated parameter(s)');
end
table.insert (out, render_maint(args.nocat)); -- maintenance messages and categories
 
Line 1,501 ⟶ 1,507:
local function lang_xx_italic (frame)
local args = lang_xx_args_get (frame, templates.langxx);
args.fn = nil; -- unset because not supported but this function might have been called by {{lang|fn=lang_xx_italic|...}}
 
local msg = parameter_validate (args, templates.langxx); -- verify that all supplied parameters are supported by {{lang-??}}
if msg then
return make_error_msg (msg, args, templates.langxx); -- when template has unsupported params, abandon with error message
end
 
Line 1,532 ⟶ 1,539:
local function lang_xx_inherit (frame)
local args = lang_xx_args_get (frame, templates.langxx);
args.fn = nil; -- unset because not supported but this function might have been called by {{lang|fn=lang_xx_inherit|...}}
 
local msg = parameter_validate (args, templates.langxx); -- verify that all supplied parameters are supported by {{lang-??}}
if msg then
return make_error_msg (msg, args, templates.langxx); -- when template has unsupported params, abandon with error message
end
 
Line 1,613 ⟶ 1,621:
 
local function langx (frame)
local args_t = lang_xx_args_get (frame, templates.langx); -- get the arguments; 'Langx' is the <base_template> used to decide which positional param is 'text', 'translit', 'lit'
return _langx (args_t);