<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.returnofreckoning.com/index.php?action=history&amp;feed=atom&amp;title=API%3AGetStringFormatFromTable</id>
	<title>API:GetStringFormatFromTable - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.returnofreckoning.com/index.php?action=history&amp;feed=atom&amp;title=API%3AGetStringFormatFromTable"/>
	<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:GetStringFormatFromTable&amp;action=history"/>
	<updated>2026-10-17T15:53:30Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://wiki.returnofreckoning.com/index.php?title=API:GetStringFormatFromTable&amp;diff=30470&amp;oldid=prev</id>
		<title>Maintenance script: UI Lua API import (WAR 1.4.8)</title>
		<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:GetStringFormatFromTable&amp;diff=30470&amp;oldid=prev"/>
		<updated>2026-10-16T19:45:05Z</updated>

		<summary type="html">&lt;p&gt;UI Lua API import (WAR 1.4.8)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{LuaApi|group=Interface}}&lt;br /&gt;
Returns a localised string from a string table with parameters filled in.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
text = GetStringFormatFromTable(tableName, id, params)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Arguments ==&lt;br /&gt;
;tableName : &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt; – Name of the string table.&lt;br /&gt;
;id : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – Index of the string in the table.&lt;br /&gt;
;params : &amp;lt;code&amp;gt;wstring-table&amp;lt;/code&amp;gt; – Array of wide strings to substitute into the string&amp;#039;s placeholders, in order.&lt;br /&gt;
&lt;br /&gt;
== Returns ==&lt;br /&gt;
;text : &amp;lt;code&amp;gt;wstring&amp;lt;/code&amp;gt; – The string with the parameters substituted.&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
* The table name is matched without regard to case.&lt;br /&gt;
* Every entry of &amp;lt;code&amp;gt;params&amp;lt;/code&amp;gt; must be a wide string. The stock helper in &amp;lt;code&amp;gt;easystem_strings/source/stringutils.lua&amp;lt;/code&amp;gt; converts each entry with &amp;lt;code&amp;gt;WideStringFromData&amp;lt;/code&amp;gt; before calling.&lt;br /&gt;
* If &amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt; is outside the table, the result is built from an empty string, so &amp;lt;code&amp;gt;L&amp;quot;&amp;quot;&amp;lt;/code&amp;gt; is returned. No message is logged.&lt;br /&gt;
* If the table does not exist, error messages are logged and no string is produced. The stock helper guards against this with &amp;lt;code&amp;gt;or L&amp;quot;&amp;quot;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Errors ==&lt;br /&gt;
* &amp;lt;code&amp;gt;StringTable %s does not exist.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;Error in function call &amp;#039;GetStringFormatFromTable&amp;#039;: String Table %s does not exist.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;Error in function call &amp;#039;GetStringFormatFromTable&amp;#039;: Id %d is invalid for table %s.&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;This message exists in the client but never appears: the string lookup it depends on always reports success.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
From &amp;lt;code&amp;gt;easystem_strings/source/stringutils.lua&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
return GetStringFormatFromTable( &amp;quot;Default&amp;quot;, StringTables.Default.LABEL_LIST_FORMAT, { currentListText, newItemText } )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the same file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
-- Convert all params to wstrings&lt;br /&gt;
for index, parameter in ipairs (paramTable)&lt;br /&gt;
do&lt;br /&gt;
    paramTable[index] = WideStringFromData (parameter)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
text = GetStringFormatFromTable( tableName, id, paramTable ) or L&amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[API:GetStringFromTable|GetStringFromTable]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>