Neuanfang mit französischem Modul

This commit is contained in:
2025-05-05 23:25:00 +02:00
parent cf24ef97df
commit 3f74b8dfdd
3135 changed files with 38383 additions and 93206 deletions
-43
View File
@@ -1,43 +0,0 @@
package.path = package.path .. ";luajson/?.lua"
local JSON = require"json"
--local enjsonf = "/home/morr/foundry/foundrydata-dev/Data/modules/wfrp4e-dotr/lang/en.json"
local careerv10 = "careerv10.json"
local goodC = "../compendium/wfrp4e-core.items.json"
local fp = io.open(careerv10, "r")
local c10 = JSON.decode( fp:read("*a") )
fp:close()
local fp = io.open(goodC, "r")
local good10 = JSON.decode( fp:read("*a") )
fp:close()
for k1, v1 in pairs( good10.entries) do
for k2, v2 in pairs(c10.entries) do
if v1.id == v2.id then
local careerGroup = string.match(v2.description, "{([%w%s]*)}")
local careerDE
for k3, v3 in pairs( good10.entries) do
if v3.id == careerGroup then
careerDE = v3.name
end
end
if ( careerGroup == 'Slayer' ) then
careerDE = "Slayer"
end
if careerGroup and careerDE then
local careerGroupFR = string.gsub(v2.description, careerGroup, careerDE)
v1.description = careerGroupFR
else
print("Error", v2.description)
end
--print("Career group", careerGroupFR, careerGroup)
end
end
end
local fp = io.open(goodC, "w+")
fp:write( JSON.encode(good10))
fp:close()