localizationChecker: Added metatable instead of hardcoded table entry list to improve maintainability
This commit is contained in:
1 parent
407ee71fb6
commit
3127fdb8cc
1 file changed
+8
-14
@@ -60,21 +60,15 @@ def addUpdatedTables(languageCode, dlc):
|
|||||||
if dlc != "ab+":
|
if dlc != "ab+":
|
||||||
# Add language table
|
# Add language table
|
||||||
lua.execute('EID.descriptions["'+languageCode+'"] = {}')
|
lua.execute('EID.descriptions["'+languageCode+'"] = {}')
|
||||||
# Add all tables that are assumed to exist already in ab+
|
|
||||||
updatedTables = ["collectibles", "cards", "trinkets", "ConditionalDescs"]
|
|
||||||
if dlc == "rep":
|
|
||||||
updatedTables += ["pills", "carBattery", "BFFSSynergies", "CharacterInfo", "ConditionalDescs", "VoidNames", "custom"]
|
|
||||||
if dlc == "rep+":
|
|
||||||
updatedTables += ["abyssSynergies", "horsepills", "tarotClothBuffs", "bookOfVirtuesWisps", "goldenTrinketEffects"]
|
|
||||||
|
|
||||||
# korean uses some additional addititve tables
|
# Add metatable to create missing tables on the fly
|
||||||
if languageCode == "ko_kr":
|
lua.execute('setmetatable(EID.descriptions["'+languageCode+'"], {\
|
||||||
if dlc == "rep":
|
__index = function(tbl, key)\
|
||||||
updatedTables += ["dice", "MCM"]
|
local newTbl = {}\
|
||||||
else:
|
rawset(tbl, key, newTbl)\
|
||||||
updatedTables += ["bookOfVirtuesWisps"]
|
return newTbl\
|
||||||
for table in updatedTables:
|
end\
|
||||||
lua.execute('EID.descriptions["'+languageCode+'"].'+table+' = {}')
|
})')
|
||||||
|
|
||||||
# find entries in table2 that are missing or different than in table 1
|
# find entries in table2 that are missing or different than in table 1
|
||||||
def compare_tables(table1, table2, prev_key):
|
def compare_tables(table1, table2, prev_key):
|
||||||
|
|||||||
Reference in new issue
Block a user