<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3ASandbox%2FJohnuniq%2Fmessage</id>
	<title>Module:Sandbox/Johnuniq/message - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3ASandbox%2FJohnuniq%2Fmessage"/>
	<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Sandbox/Johnuniq/message&amp;action=history"/>
	<updated>2026-04-21T02:08:02Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://stockhub.co/index.php?title=Module:Sandbox/Johnuniq/message&amp;diff=145631&amp;oldid=prev</id>
		<title>imported&gt;Johnuniq: test mw.message.newRawMessage per WT:Lua#Module localisation</title>
		<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Sandbox/Johnuniq/message&amp;diff=145631&amp;oldid=prev"/>
		<updated>2014-02-05T00:22:41Z</updated>

		<summary type="html">&lt;p&gt;test mw.message.newRawMessage per &lt;a href=&quot;/index.php?title=WT:Lua&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;WT:Lua (page does not exist)&quot;&gt;WT:Lua#Module localisation&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- Adapt message() from Module:Documentation/sandbox to test&lt;br /&gt;
-- Anomie&amp;#039;s advice at [[WT:Lua#Module localisation]]:&lt;br /&gt;
--   mw.message.newRawMessage(&amp;quot;text&amp;quot;):params(&amp;quot;$1&amp;quot;, &amp;quot;$2&amp;quot;, &amp;quot;etc&amp;quot;):plain()&lt;br /&gt;
-- To see output, preview following in a sandbox:&lt;br /&gt;
--   {{#invoke:Sandbox/Johnuniq/message|main}}&lt;br /&gt;
&lt;br /&gt;
local cfg = {&lt;br /&gt;
	invalid = &amp;#039;Input &amp;quot;$1&amp;quot; is not a number&amp;#039;,&lt;br /&gt;
	too_big = &amp;#039;Input $1 should be less than $2&amp;#039;,&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
local function message(cfgKey, valArray)&lt;br /&gt;
	local msg = cfg[cfgKey]&lt;br /&gt;
	if valArray then&lt;br /&gt;
		return mw.message.newRawMessage(msg):params(valArray):plain()&lt;br /&gt;
	end&lt;br /&gt;
	return msg&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local tests = {&lt;br /&gt;
	{ &amp;#039;invalid&amp;#039;, { &amp;#039;xyz&amp;#039; } },&lt;br /&gt;
	{ &amp;#039;too_big&amp;#039;, { &amp;#039;42&amp;#039;, &amp;#039;12&amp;#039; } },&lt;br /&gt;
	{ &amp;#039;too_big&amp;#039;, { 42, 12 } },&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
local function main()&lt;br /&gt;
	local result = {}&lt;br /&gt;
	for _, t in ipairs(tests) do&lt;br /&gt;
		result[#result + 1] = &amp;#039;*&amp;#039; .. message(t[1], t[2]) .. &amp;#039;\n&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	return table.concat(result)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return { main = main }&lt;/div&gt;</summary>
		<author><name>imported&gt;Johnuniq</name></author>
	</entry>
</feed>