Add career descriptions translation

This commit is contained in:
2021-12-23 10:13:10 +01:00
parent ebfcfbf70f
commit ffb74768fd
4 changed files with 368 additions and 339 deletions

View File

@@ -0,0 +1,29 @@
package.path = package.path .. ";luajson/?.lua"
local JSON = require"json"
local beastref_f = "../compendium/wfrp4e.bestiary.json"
local beastdescr_f = "compendium_wfrp4e.bestiary.json"
local f1 = io.open(beastref_f)
local strjson = f1:read("*a")
local beastref = JSON.decode(strjson)
local f2 = io.open(beastdescr_f)
strjson = f2:read("*a")
f2:close()
local beastdescr = JSON.decode(strjson)
for _, beasttext in pairs(beastdescr.entries) do
for _, beastgood in pairs(beastref.entries) do
if beasttext.id == beastgood.id then
beastgood.description = beasttext.description
end
end
end
local jsonout = JSON.encode( beastref )
local fout = io.open("beasts.json", "w+")
fout:write( jsonout )
fout:close()