Sync with latest version
This commit is contained in:
@@ -1,30 +1,26 @@
|
||||
package.path = package.path .. ";luajson/?.lua"
|
||||
local JSON = require"json"
|
||||
|
||||
local enjsonf = "../../swade/src/lang/en.yml"
|
||||
local enjsonf = "en.json"
|
||||
local frjsonf = "../fr.json"
|
||||
|
||||
local fp = io.open(enjsonf, "r")
|
||||
local line = fp:read()
|
||||
local entags = {}
|
||||
while line do
|
||||
--print("LINE", line)
|
||||
local key, value = line:match("([%w%.]*):([>%-%+%p%s%w%d%.]*)" )
|
||||
if key then
|
||||
entags[key] = value
|
||||
end
|
||||
line = fp:read()
|
||||
end
|
||||
local entags = JSON.decode( fp:read("*a") )
|
||||
fp:close()
|
||||
entags = entags.SWADE
|
||||
|
||||
fp = io.open(frjsonf, "r")
|
||||
local frtags = JSON.decode( fp:read("*a") )
|
||||
fp:close()
|
||||
frtags = frtags.SWADE
|
||||
|
||||
local todisplay = {}
|
||||
for tag, value in pairs(entags) do
|
||||
if not frtags[tag] then
|
||||
todisplay[#todisplay+1] = { tag=tag, value=value }
|
||||
if type(value) == "table" then
|
||||
value = JSON.encode(value)
|
||||
end
|
||||
todisplay[#todisplay+1] = { tag=tag, value = value }
|
||||
end
|
||||
end
|
||||
|
||||
@@ -33,7 +29,8 @@ table.sort(todisplay, function (a, b)
|
||||
end
|
||||
)
|
||||
for _, tagDef in pairs(todisplay) do
|
||||
print('"'.. tagDef.tag ..'":"'.. tagDef.value..'",')
|
||||
print("\"" .. tagDef.tag .."\":" .. tagDef.value)
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user