Added markup integrity check into the language debugging feature
This commit is contained in:
1 parent
fd6325b8f6
commit
ee349f5829
1 file changed
+25
-1
+25
-1
@@ -3,7 +3,7 @@ local showDebugChars = false
|
||||
|
||||
-- check integrity of language files
|
||||
|
||||
local languageFilesToCheck = {"spa"} -- EID.Languages -- single file check {"ko_kr"}
|
||||
local languageFilesToCheck = {"cs_cz"} -- EID.Languages -- single file check {"ko_kr"}
|
||||
|
||||
-- count en_us entries for stats
|
||||
local count = 0
|
||||
@@ -30,9 +30,33 @@ for i,lang in ipairs(languageFilesToCheck) do
|
||||
progress[2] = progress[2] + 1
|
||||
elseif type(table2[k]) == "table" then
|
||||
EID:compareTables(table1[k], table2[k], k, progress)
|
||||
else
|
||||
-- check for broken markup stuff
|
||||
local filteredText = EID:replaceShortMarkupStrings(table2[k])
|
||||
local textPartsTable = EID:filterColorMarkup(filteredText, EID:getNameColor())
|
||||
for _, textPart in ipairs(textPartsTable) do
|
||||
local filteredSpriteText, spriteTable = EID:filterIconMarkup(textPart[1], 0, 0)
|
||||
|
||||
if string.find(filteredSpriteText, "{{") or string.find(filteredSpriteText, "}}") then
|
||||
print(" Table '" .. prevKey .. "' entry '" .. k .. "' does contain a broken markup object: '" .. table2[k])
|
||||
progress[1] = progress[1] - 2
|
||||
progress[2] = progress[2] + 1
|
||||
break
|
||||
else
|
||||
for _, sprite in ipairs(spriteTable) do
|
||||
if sprite[1][1] == "ERROR" then
|
||||
print(" Table '" .. prevKey .. "' entry '" .. k .. "' does contain a bad icon markup in string: '" .. table2[k])
|
||||
progress[1] = progress[1] - 2
|
||||
progress[2] = progress[2] + 1
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local progress = { 0, 0 }
|
||||
EID:compareTables(EID.descriptions["en_us"], EID.descriptions[lang], lang, progress)
|
||||
|
||||
|
||||
Reference in new issue
Block a user