Jump to content

Module:Native name and Module:Native name/sandbox: Difference between pages

(Difference between pages)
Page 1
Page 2
Content deleted Content added
No edit summary
 
some simplifications
 
Line 104: Line 104:
args_t.parensize = args_t.parensize or args_t.fontsize or '100%';
args_t.parensize = args_t.parensize or args_t.fontsize or '100%';
args_t.fontsize = nil; -- unset as unneeded
args_t.fontsize = nil; -- unset as unneeded

if not lang_module._is_ietf_tag (args_t[1]) then
args_t[1] = lang_module._tag_from_name ({args_t[1]});
if args_t[1]:find ('Error') then
return error_msg ((args_t.index and messages_t.tag_required_idx) or messages_t.tag_required, template, args_t.index)
end
end


local out_t = {};
local out_t = {};
Line 125: Line 118:
if args_t.nolink then
if args_t.nolink then
table.insert (out_t, table.concat ({'(', lang_module._name_from_tag ({args_t[1], ['template']=template}), ')'}));
table.insert (out_t, table.concat ({'(', lang_module._name_from_tag ({args_t[1], ['template']=template}), ')'}));
elseif lang_module._is_ietf_tag (args_t[1]) then
table.insert (out_t, table.concat ({'(', lang_module._name_from_tag ({args_t[1], ['link'] ='yes', ['template']=template}), ')'}));
else
else
table.insert (out_t, '(language?)'); -- TODO: any reason to keep this?
if lang_module._is_ietf_tag (args_t[1]) then
table.insert (out_t, table.concat ({'(', lang_module._name_from_tag ({args_t[1], ['link'] ='yes', ['template']=template}), ')'}));
else
table.insert (out_t, '(language?)'); -- TODO: any reason to keep this?
end
end
end


Line 277: Line 268:
return table.concat ({value, error_msg (messages_t.malformed_param, 'native name checker')}, ' '); -- no {{lang}} or {{native_name}} template
return table.concat ({value, error_msg (messages_t.malformed_param, 'native name checker')}, ' '); -- no {{lang}} or {{native_name}} template
end
end
if 1 < count then
if 1 < count
if not value:find ('<div class="plainlist *" *>') or not value:find ('</div>$') then -- must be wrapped in 'plainlist' div
and not (value:find ('<div class="plainlist *" *>')
return table.concat ({value, error_msg (messages_t.list_markup, 'native name checker')}, ' ');
and value:find ('</div>$'))
then
return table.concat ({value, error_msg (messages_t.list_markup, 'native name checker')}, ' ');
end
end
end