Module:Sandbox/trappist the monk/map non en params explained

--2 translator module. Likely usable for other-language wikis that use some form of Module:Citation/CS1.

To use this tool: copy the table from the other-language wiki's Module:Citation/CS1/Configuration and paste it in this module. set the value for In the debug console: =p.map_non_en_params

returns a table of non-English parameter names mapped to their non-English metaparameter names; enumeratedparameters at the end. When the non-English implementation of Module:Citation/CS1/Configuration uses non-English metaparameter names, this tool may not be as useful because the non-English metaparameter names won'tmatch the en.wiki metaparameter names in Module:Citation/CS1/Whitelist

require('strict');

local lang_code = 'pt';

local aliases =

local whitelist = mw.loadData ('Module:Citation/CS1/Whitelist');

local out_t = ;local enum_out_t = ;

local function map_non_en_params for meta_param, params_t in pairs (aliases) do if 'string'

type (params_t) then params_t = params_t:lower; -- force to lower case if not whitelist.basic_arguments[params_t] then table.insert (out_t, '[\'' .. params_t .. '\'] = \ .. meta_param .. '\','); end else for _, param in ipairs (params_t) do param = param:lower; -- force to lower case if param:find ('#') then if not whitelist.numbered_arguments[param] then table.insert (enum_out_t, '[\'' .. param .. '\'] = \ .. meta_param .. '\','); end elseif not whitelist.basic_arguments[param] then table.insert (out_t, '[\'' .. param .. '\'] = \ .. meta_param .. '\','); end end end end table.sort (out_t); table.sort (enum_out_t);

table.insert (out_t, 1, '\t' .. lang_code .. ' =,'); return table.concat (out_t, '\n\t\t');end

return