forked from mrkubax10/industrialtest
Some final fixes in guide text
This commit is contained in:
19
guide.lua
19
guide.lua
@@ -66,9 +66,9 @@ local function createMachineInformationTable(fields,machineName,num)
|
|||||||
local fieldLabels={
|
local fieldLabels={
|
||||||
inputVoltage="Input voltage level",
|
inputVoltage="Input voltage level",
|
||||||
outputVoltage="Output voltage level",
|
outputVoltage="Output voltage level",
|
||||||
voltage="Voltage",
|
voltage="Voltage level",
|
||||||
lowVoltage="Low voltage",
|
lowVoltage="Low voltage level",
|
||||||
highVoltage="High voltage",
|
highVoltage="High voltage level",
|
||||||
damageRed="Damage reduction",
|
damageRed="Damage reduction",
|
||||||
recipe="Recipe type",
|
recipe="Recipe type",
|
||||||
powerCapacity="Power capacity",
|
powerCapacity="Power capacity",
|
||||||
@@ -87,7 +87,7 @@ local function createMachineInformationTable(fields,machineName,num)
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
return createTable(rows,false,string.format("Figure %d. Information for %s",(num or 1),machineName))
|
return createTable(rows,false,S("Figure @1. Information for @2",(num or 1),machineName))
|
||||||
end
|
end
|
||||||
|
|
||||||
local pages={
|
local pages={
|
||||||
@@ -1887,7 +1887,16 @@ local pages={
|
|||||||
local function preprocessHypertext(content,vars)
|
local function preprocessHypertext(content,vars)
|
||||||
-- Find and replace strings which should be translated, this pattern matches any string that doesn't include | which is contained within || at both ends
|
-- Find and replace strings which should be translated, this pattern matches any string that doesn't include | which is contained within || at both ends
|
||||||
content=string.gsub(content,"||([^|]+)||",function(sourceString)
|
content=string.gsub(content,"||([^|]+)||",function(sourceString)
|
||||||
return S(sourceString)
|
-- Replace all sequences which should be treated as variables inside translation with format string
|
||||||
|
local trFormatIndex=1
|
||||||
|
local trFormatValues={}
|
||||||
|
sourceString=string.gsub(sourceString,"{{([^{}]+)}}",function(var)
|
||||||
|
local result=string.format("@%d",trFormatIndex)
|
||||||
|
trFormatIndex=trFormatIndex+1
|
||||||
|
table.insert(trFormatValues,vars[var] or "nil")
|
||||||
|
return result
|
||||||
|
end)
|
||||||
|
return S(sourceString,unpack(trFormatValues))
|
||||||
end)
|
end)
|
||||||
|
|
||||||
-- Replace all sequences which should be treated as variables with values provided in vars
|
-- Replace all sequences which should be treated as variables with values provided in vars
|
||||||
|
|||||||
Reference in New Issue
Block a user