issues/696

This commit is contained in:
恍兮惚兮 2024-04-28 04:39:26 +08:00
parent 7e19b3fc8b
commit b97fa06d54
2 changed files with 24 additions and 13 deletions

View File

@ -530,16 +530,15 @@ def parsemayberegexreplace(dict, res):
return res return res
def getlanguse():
return static_data["language_list_translator_inner"][globalconfig["languageuse"]]
def checkpostlangmatch(name): def checkpostlangmatch(name):
for item in static_data["transoptimi"]: for item in static_data["transoptimi"]:
if name == item["name"]: if name == item["name"]:
try: try:
return ( return getlanguse() == item["languageuse"]
static_data["language_list_translator_inner"][
globalconfig["languageuse"]
]
== item["languageuse"]
)
except: except:
return True return True

View File

@ -58,11 +58,23 @@ class TS(basetransdev):
) )
self.currenttext = content self.currenttext = content
currtext = "" currtext = ""
while self.currenttext == content: if self.tgtlang == "Arabic":
time.sleep(0.01) # get text before violate usage policies.
newcurr = self.getcurr(idx) while self.currenttext == content:
if newcurr == currtext: time.sleep(1) # get text before violate usage policies.
continue
yield newcurr[len(currtext) :] newcurr = self.getcurr(idx)
currtext = newcurr needbreak = newcurr == currtext and newcurr != ""
currtext = newcurr
if needbreak:
break
yield currtext
else:
while self.currenttext == content:
time.sleep(0.01) # get text before violate usage policies.
newcurr = self.getcurr(idx)
if newcurr == currtext:
continue
yield newcurr[len(currtext) :]
currtext = newcurr