Some Adjustments

This commit is contained in:
dazedanon 2025-10-05 11:35:44 -05:00
parent 9a416925aa
commit 10eadbee43
2 changed files with 18 additions and 2 deletions

View file

@ -90,7 +90,7 @@ FIXTEXTWRAP = True
# IGNORETLTEXT: Skip Translated Text.
IGNORETLTEXT = False
# TLSYSTEMVARIABLES: Translate System Variables. (Optional but sometimes necessary. Can break stuff.)
TLSYSTEMVARIABLES = True
TLSYSTEMVARIABLES = False
# Dialogue / Scroll / Choices (Main Codes)
CODE101 = True
@ -1389,8 +1389,11 @@ def searchCodes(page, pbar, jobList, filename):
r"^((?:[\\]+[^cCnNiIkKvVSs{}]+?\[[\d\w\W]+?\]?\])+)",
nextString,
)
formatMatch = re.search(r"(^[\\]+[\W]+?)", nextString)
if ffMatchNS != None:
nextString = nextString.replace(ffMatchNS.group(1), "")
if formatMatch != None:
nextString = nextString.replace(formatMatch.group(1), "")
if nextString and nextString[0] in [
"",
@ -1813,6 +1816,7 @@ def searchCodes(page, pbar, jobList, filename):
"LogWindow": ("text", None),
"BattleLogOutput": ("message", None),
"TorigoyaMZ_NotifyMessage_CommandMessage": ("message", None),
"NUUN_SaveScreen": ("AnyName", None),
}
for key, (argVar, font) in headerMappings.items():

View file

@ -215,8 +215,20 @@ def translateTxt(data, filename, translatedList):
global LOCK, ESTIMATE, FILENAME, PBAR, MISMATCH
i = 0
# Regex
lineTextRegex = r"(?:^\[.+?\]:)?(.+)"
speakerTextRegex = r"^\[(.+?)\]"
while i < len(data):
lineTextRegex = r"(.+)"
# Speaker
match = re.search(speakerTextRegex, data[i])
if match:
# Get Speaker
speakerData = getSpeaker(match.group(1))
speaker = speakerData[0]
tokens[0] += speakerData[1][0]
tokens[1] += speakerData[1][1]
data[i] = data[i].replace(match.group(1), speaker)
# Dialogue
match = re.search(lineTextRegex, data[i])