Module:CS1 translator/data explained

--2 equivalent parameter name. Parameter names that do not have any cs1|2 equivalency or that are treated as special cases are also listed here for completeness and to document them; these are asigned nil for a value (same as not present in the table).

All key values (non-English parameter names) are normalized to lowercase.

local params_main_t =

----------------------------< P A R A M S _ D A T E S _ T >--------------------------------------------------

is a k/v_t table where k is the the Wikimedia subdomain (language code; 'en' in 'en.wikipedia.org')and v_t is a k/v_t table where k identifies the 'date' or 'date-part' and v_t is a sequence table of associatednon-English parameter alias names

non-English parameter names are normalized to lowercase.

local params_dates_t =

--date=, |year=, |month=, or |day= equivalents.

table of k/v_t pairs where k/v_t in the outer table is: k – the Wikimedia subdomain (language code; 'en' in 'en.wikipedia.org') v_t – a table of k/v pairs where k – the non-English parameter name v – the directly translatable cs1|2 equivalent date-holding parameters that are not |date=, |year=, |month=, or |day= equivalents.

All key values normalized to lowercase.

local params_misc_dates_t =

--id=

table of k/v_t pairs where k/v_t in the outer table is: k – the Wikimedia subdomain (language code; 'en' in 'en.wikipedia.org') v_t – a sequence table of sequence tables where: [1] is the parameter name normalized to lower case [2] is the associated wikitext label to be used in the rendering [3] is the url-prefix to be attached to the identifier value from the template parameter [4] is the url-postfix to be attached to the identifier value parameter names are normalized to lowercase.

local params_identifiers_t =

--language= parameter

local params_language_t =

--

local function build_params_main_t local out_t = ; -- table goes here for lang, v_t in pairs (params_main_t) do -- for each language table in params_main_t out_t[lang] = ; -- create a table in out_t for for k, v in pairs (v_t) do -- for each parameter in the language table if 'string' ~= type (v) then error (lang .. ' ' .. k .. ' value not a string'); -- glaring error message because non-string values not allowed end if v then -- if the parameter has a non-nil translation (not a special, not a parameter without cs1|2 equivalent) if (k:find ('#', 1, true) and not v:find ('#', 1, true)) or (not k:find ('#', 1, true) and v:find ('#', 1, true))then error (lang .. '[' .. k .. ']: '.. v .. ' missing \'#\); -- glaring error message because '#' required on both sides else if k:find ('#', 1, true) then -- does the parmeter name have the enumerator character '#'? out_t[lang][k:gsub('#', '')] = v:gsub('#', ); -- add a non-enumerated version of the parameter to the output end out_t[lang][k] = v; -- add the parameter to the output; may be an enumerated param or not end end end end return out_t; -- and doneend

----------------------------< E X P O R T E D T A B L E S >------------------------------------------------

return