Reverted language code changes thruout the mod
- Added EID.DefaultLanguageCode
This commit is contained in:
1 parent
6e15cc3414
commit
d44fa187b7
44 files changed
+157
-154
No files matched your search
@@ -62,7 +62,7 @@ def addUpdatedTables(languageCode, dlc):
|
||||
updatedTables += ["abyssSynergies", "horsepills", "tarotClothBuffs", "bookOfVirtuesWisps", "goldenTrinketEffects"]
|
||||
|
||||
# korean uses some additional addititve tables
|
||||
if languageCode == "ko":
|
||||
if languageCode == "ko_kr":
|
||||
if dlc == "rep":
|
||||
updatedTables += ["dice", "MCM"]
|
||||
else:
|
||||
@@ -109,19 +109,19 @@ def compare_tables(table1, table2, prev_key):
|
||||
|
||||
|
||||
languageProgress = {}
|
||||
en_entries = {}
|
||||
english_entries = {}
|
||||
for dlc in dlcs:
|
||||
lua.execute('REPENTOGON = true; EID = {}; EID.descriptions = {}; function EID:updateDescriptionsViaTable(changeTable, tableToUpdate) for k,v in pairs(changeTable) do if v == "" then tableToUpdate[k] = nil else tableToUpdate[k] = v end end end')
|
||||
g = lua.globals()
|
||||
addUpdatedTables("en", dlc)
|
||||
addUpdatedTables("en_us", dlc)
|
||||
|
||||
# Read English language files first
|
||||
englishFile = glob.glob(SOURCE_MOD_DIRECTORY+"/**/"+dlc+"/en.lua", recursive=True)[0]
|
||||
englishFile = glob.glob(SOURCE_MOD_DIRECTORY+"/**/"+dlc+"/en_us.lua", recursive=True)[0]
|
||||
print("reading:", englishFile)
|
||||
lua.execute(open(englishFile, "r", encoding="UTF-8").read())
|
||||
|
||||
en_entries[dlc] = count_entries(g.EID['descriptions']['en'])
|
||||
print("English "+dlc+" entries:", en_entries[dlc])
|
||||
english_entries[dlc] = count_entries(g.EID['descriptions']['en_us'])
|
||||
print("English "+dlc+" entries:", english_entries[dlc])
|
||||
|
||||
|
||||
langFiles = []
|
||||
@@ -131,7 +131,7 @@ for dlc in dlcs:
|
||||
langFiles += glob.glob(SOURCE_MOD_DIRECTORY+"/**/"+dlc+"/*.lua", recursive=True)
|
||||
# Read other language files
|
||||
for file in langFiles:
|
||||
if "en" not in file and "transformations" not in file:
|
||||
if "en_us" not in file and "transformations" not in file:
|
||||
languageCode = os.path.basename(file).replace(".lua","")
|
||||
print("reading:",file)
|
||||
addUpdatedTables(languageCode, dlc)
|
||||
@@ -141,16 +141,16 @@ for dlc in dlcs:
|
||||
|
||||
# Evaluate language for completeness
|
||||
print(f"Evaluating language '{languageCode}'..")
|
||||
errorCount = compare_tables(g.EID['descriptions']["en"], g.EID['descriptions'][languageCode], languageCode+"("+dlc+")")
|
||||
percentage = (en_entries[dlc] - errorCount) / en_entries[dlc] * 100
|
||||
errorCount = compare_tables(g.EID['descriptions']["en_us"], g.EID['descriptions'][languageCode], languageCode+"("+dlc+")")
|
||||
percentage = (english_entries[dlc] - errorCount) / english_entries[dlc] * 100
|
||||
languageProgress[languageCode][dlc] = [percentage, errorCount]
|
||||
print(f"{Red}Errors found: {errorCount} / {en_entries[dlc]}{Color_Off}\n\n")
|
||||
print(f"{Red}Errors found: {errorCount} / {english_entries[dlc]}{Color_Off}\n\n")
|
||||
|
||||
|
||||
# Calculate total english entries
|
||||
total_en_entries = 0
|
||||
for entries in en_entries.values():
|
||||
total_en_entries += entries
|
||||
total_english_entries = 0
|
||||
for entries in english_entries.values():
|
||||
total_english_entries += entries
|
||||
|
||||
# Write git Workflow summary
|
||||
gitWorkflowSummary = "### Translation progress\n| Language | Completion (AB+) |Completion (REP) |Completion (REP+) |Completion (Total) |\n|---|---|---|---|---|\n"
|
||||
@@ -169,12 +169,12 @@ for lang in languageProgress.keys():
|
||||
else:
|
||||
print(
|
||||
f"\t{BWhite}{lang}({dlc}){Color_Off}\t\t{Red}DLC translation missing!{Color_Off}")
|
||||
gitCompletionMessage = f"0% ({en_entries[dlc]} left)"
|
||||
totalMissing += en_entries[dlc]
|
||||
gitCompletionMessage = f"0% ({english_entries[dlc]} left)"
|
||||
totalMissing += english_entries[dlc]
|
||||
|
||||
gitWorkflowSummary += f"| {gitCompletionMessage} "
|
||||
|
||||
totalPercent = round((total_en_entries - totalMissing) / total_en_entries * 100, 2)
|
||||
totalPercent = round((total_english_entries - totalMissing) / total_english_entries * 100, 2)
|
||||
gitWorkflowSummary += f"|{totalPercent}% ({totalMissing}) "
|
||||
gitWorkflowSummary += "|\n"
|
||||
|
||||
|
||||
Reference in new issue
Block a user