Smal
This commit is contained in:
parent
03005d6769
commit
3333e792f4
2 changed files with 33 additions and 1 deletions
|
|
@ -111,6 +111,7 @@ CODE657 = False
|
|||
CODE356 = False
|
||||
CODE320 = False
|
||||
CODE324 = False
|
||||
CODE325 = False
|
||||
CODE111 = False
|
||||
CODE108 = False
|
||||
|
||||
|
|
@ -2527,6 +2528,37 @@ def searchCodes(page, pbar, jobList, filename):
|
|||
# Set Data
|
||||
codeList[i]["parameters"][1] = translatedText
|
||||
|
||||
### Event Code: 325
|
||||
if "code" in codeList[i] and codeList[i]["code"] == 325 and CODE325 is True:
|
||||
jaString = codeList[i]["parameters"][1]
|
||||
if not isinstance(jaString, str):
|
||||
i += 1
|
||||
continue
|
||||
|
||||
# Definitely don't want to mess with files
|
||||
if "■" in jaString or "_" in jaString:
|
||||
i += 1
|
||||
continue
|
||||
|
||||
# If there isn't any Japanese in the text just skip
|
||||
if not re.search(LANGREGEX, jaString):
|
||||
i += 1
|
||||
continue
|
||||
|
||||
# Translate
|
||||
response = getSpeaker(jaString)
|
||||
translatedText = response[0]
|
||||
totalTokens[0] += response[1][0]
|
||||
totalTokens[1] += response[1][1]
|
||||
|
||||
# Remove characters that may break scripts
|
||||
charList = [".", '"', "'", "\\n"]
|
||||
for char in charList:
|
||||
translatedText = translatedText.replace(char, "")
|
||||
|
||||
# Set Data
|
||||
codeList[i]["parameters"][1] = translatedText
|
||||
|
||||
# Iterate
|
||||
else:
|
||||
i += 1
|
||||
|
|
|
|||
|
|
@ -258,7 +258,7 @@ def translatePlugin(data, pbar, filename, translatedList):
|
|||
# r'"Text[\\]+":[\\]+"(.+?)[\\]+",'
|
||||
# r'"HelpText[\\]+":[\\]+"(.+?)[\\]+",'
|
||||
# r"this.drawTextEx\(\\'(.+?)\',"
|
||||
# r'txtSubject.+?"(.+)'
|
||||
# r'txtSubject.+?"(.+)"'
|
||||
regex = r'txtSubject.+?"(.+)"'
|
||||
matchList = re.findall(regex, data[i])
|
||||
if len(matchList) > 0:
|
||||
|
|
|
|||
Loading…
Reference in a new issue