<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="vi">
	<id>https://bktt.vn/index.php?action=history&amp;feed=atom&amp;title=M%C3%B4_%C4%91un%3AMonth_translator</id>
	<title>Mô đun:Month translator - Lịch sử thay đổi</title>
	<link rel="self" type="application/atom+xml" href="https://bktt.vn/index.php?action=history&amp;feed=atom&amp;title=M%C3%B4_%C4%91un%3AMonth_translator"/>
	<link rel="alternate" type="text/html" href="https://bktt.vn/index.php?title=M%C3%B4_%C4%91un:Month_translator&amp;action=history"/>
	<updated>2026-06-02T06:08:27Z</updated>
	<subtitle>Lịch sử thay đổi của trang này ở wiki</subtitle>
	<generator>MediaWiki 1.35.0</generator>
	<entry>
		<id>https://bktt.vn/index.php?title=M%C3%B4_%C4%91un:Month_translator&amp;diff=274&amp;oldid=prev</id>
		<title>Tttrung: Tạo trang mới với nội dung “require ('Module:No globals')  local data = mw.loadData ('Module:month translator/data');   --[[--------------------------&lt; M O N T H _ X L A T E &gt;-------…”</title>
		<link rel="alternate" type="text/html" href="https://bktt.vn/index.php?title=M%C3%B4_%C4%91un:Month_translator&amp;diff=274&amp;oldid=prev"/>
		<updated>2020-10-02T02:28:12Z</updated>

		<summary type="html">&lt;p&gt;Tạo trang mới với nội dung “require (&amp;#039;Module:No globals&amp;#039;)  local data = mw.loadData (&amp;#039;Module:month translator/data&amp;#039;);   --[[--------------------------&amp;lt; M O N T H _ X L A T E &amp;gt;-------…”&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Trang mới&lt;/b&gt;&lt;/p&gt;&lt;div&gt;require ('Module:No globals')&lt;br /&gt;
&lt;br /&gt;
local data = mw.loadData ('Module:month translator/data');&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; M O N T H _ X L A T E &amp;gt;--------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
{{#invoke:Sandbox/trappist the monk/month translator|month_xlate|&amp;lt;date&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function month_xlate (frame)&lt;br /&gt;
	local t = {};&lt;br /&gt;
	local day, month, year;&lt;br /&gt;
	&lt;br /&gt;
	if 'dump' == frame.args[1] then												-- frame.args[1] = 'dump' to dump month_names table; &lt;br /&gt;
		return mw.dumpObject (data.month_names);&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	for i, pattern in ipairs (data.patterns) do										-- spin through the patterns table looking for a match&lt;br /&gt;
		local c1, c2, c3;														-- captures in the 'pattern' from the pattern table go here&lt;br /&gt;
&lt;br /&gt;
		c1, c2, c3 = mw.ustring.match (mw.text.trim(frame.args[1]), pattern[1]);	-- one or more captures set if source matches patterns[i][1])&lt;br /&gt;
		if c1 then																-- c1 always set on match&lt;br /&gt;
&lt;br /&gt;
			t = {&lt;br /&gt;
				[pattern[2] or 'x'] = c1,										-- fill the table of captures with the captures&lt;br /&gt;
				[pattern[3] or 'x'] = c2,										-- take index names from pattern table and assign sequential captures&lt;br /&gt;
				[pattern[4] or 'x'] = c3,										-- index name may be nil in pattern table so &amp;quot;or 'x'&amp;quot; spoofs a name for this index in this table&lt;br /&gt;
				};&lt;br /&gt;
			day = t.d or '';													-- translate table contents to named variables;&lt;br /&gt;
			month = mw.ustring.lower (t.m or '');								-- absent table entries are nil so set unused parts to empty string; lowercase for indexing&lt;br /&gt;
			month = data.override_names[month] or data.month_names[month];		-- replace non-English name with English name from translation tables&lt;br /&gt;
			year= t.y or '';&lt;br /&gt;
&lt;br /&gt;
			if month then&lt;br /&gt;
				local df = table.concat ({pattern[2], pattern[3], pattern[4]}, '');	-- extract date format from pattern table (pattern[2], pattern[3], pattern[4])&lt;br /&gt;
&lt;br /&gt;
				if 'dmy' == df then												-- for dmy dates&lt;br /&gt;
					return table.concat ({day, month, year}, ' ');				-- assemble an English language dmy date&lt;br /&gt;
				elseif 'my' == df then											-- for month year dates&lt;br /&gt;
					return table.concat ({month, year}, ' ');					-- assemble an English language dmy date&lt;br /&gt;
				elseif 'mdy' == df then											-- for mdy dates&lt;br /&gt;
					return string.format ('%s %s, %s', month, day, year);		-- assemble an English language mdy date&lt;br /&gt;
				elseif 'm' == df then											-- must be month (only valid option remaining)&lt;br /&gt;
					return month;												-- none of the above, return the translated month;&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
			break;																-- and done; if here found pattern match but did not find non-English month name in month_names{}&lt;br /&gt;
		end&lt;br /&gt;
	end	&lt;br /&gt;
	return frame.args[1];														-- if here, couldn't translate so return the original date&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; E X P O R T E D   F U N C T I O N S &amp;gt;------------------------------------------&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
return {month_xlate = month_xlate};&lt;/div&gt;</summary>
		<author><name>Tttrung</name></author>
	</entry>
</feed>