diff --git a/modules/kirikiri.py b/modules/kirikiri.py index 39d5c6b..106d69d 100644 --- a/modules/kirikiri.py +++ b/modules/kirikiri.py @@ -527,7 +527,7 @@ def elongateCharacters(text): def extractTranslation(translatedTextList, is_list): try: translatedTextList = re.sub(r'\\"+\"([^,\n}])', r'\\"\1', translatedTextList) - translatedTextList = re.sub(r"(? 0: + # Progress Bar + total = 0 + for skillArray in skillList: + total += len(skillArray) + pbar.total = total + pbar.refresh() + + # Name + response = translateGPT( + skillList[0], + "Reply with only the " + LANGUAGE + " translation of the RPG skill name", + True, + ) + nameListTL = response[0] + totalTokens[0] += response[1][0] + totalTokens[1] += response[1][1] + # Desc 1 + response = translateGPT(skillList[1], "", True) + descListTL1 = response[0] + totalTokens[0] += response[1][0] + totalTokens[1] += response[1][1] + # Desc 2 + response = translateGPT(skillList[2], "", True) + descListTL2 = response[0] + totalTokens[0] += response[1][0] + totalTokens[1] += response[1][1] + + # Check Mismatch + if ( + len(nameListTL) != len(skillList[0]) + or len(descListTL1) != len(skillList[1]) + or len(descListTL2) != len(skillList[2]) + ): + with LOCK: + if filename not in MISMATCH: + MISMATCH.append(filename) + else: + skillListTL = [nameListTL, descListTL1, descListTL2] + translate = True + # Collection for list in collectionList: if len(list) > 0: @@ -1689,6 +1782,7 @@ def searchDB(events, pbar, jobList, filename): jobList.append(armorListTL) jobList.append(enemyListTL) jobList.append(weaponsListTL) + jobList.append(skillListTL) searchDB(events, pbar, jobList, filename) except IndexError as e: @@ -1843,7 +1937,7 @@ def elongateCharacters(text): def extractTranslation(translatedTextList, is_list): try: translatedTextList = re.sub(r'\\"+\"([^,\n}])', r'\\"\1', translatedTextList) - translatedTextList = re.sub(r"(?