require('strict')local getArgs = require ('Module:Arguments').getArgs;
local data = mw.loadData ('Module:month translator/data');
--month_xlate|
local function _month_xlate (args_t) local t = ; local day, month, year; if 'dump'
c1, c2, c3 = mw.ustring.match (mw.text.trim (args_t[1]), pattern[1]); -- one or more captures set if source matches patterns[i][1]) if c1 then -- c1 always set on match
t = ; day = t.d or ; -- translate table contents to named variables; month = mw.ustring.lower (t.m or ); -- absent table entries are nil so set unused parts to empty string; lowercase for indexing month = data.override_names[month] or data.month_names_t[month]; -- replace non-English name with English name from translation tables year= t.y or ;
if month then local df = table.concat (); -- extract date format from pattern table (pattern[2], pattern[3], pattern[4])
if 'dmy'
df then -- for month year dates return table.concat (' '); -- assemble an English language dmy date elseif 'mdy'
df then -- must be month (only valid option remaining) return month; -- none of the above, return the translated month; end end break; -- and done; if here found pattern match but did not find non-English month name in
--month_xlate|
local function month_xlate (frame) return _month_xlate (getArgs (frame));end
----------------------------< E X P O R T E D F U N C T I O N S >------------------------------------------
return ;