mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-29 16:44:13 +08:00
issues/696
This commit is contained in:
parent
7e19b3fc8b
commit
b97fa06d54
@ -530,16 +530,15 @@ def parsemayberegexreplace(dict, res):
|
||||
return res
|
||||
|
||||
|
||||
def getlanguse():
|
||||
return static_data["language_list_translator_inner"][globalconfig["languageuse"]]
|
||||
|
||||
|
||||
def checkpostlangmatch(name):
|
||||
for item in static_data["transoptimi"]:
|
||||
if name == item["name"]:
|
||||
try:
|
||||
return (
|
||||
static_data["language_list_translator_inner"][
|
||||
globalconfig["languageuse"]
|
||||
]
|
||||
== item["languageuse"]
|
||||
)
|
||||
return getlanguse() == item["languageuse"]
|
||||
except:
|
||||
return True
|
||||
|
||||
|
@ -58,11 +58,23 @@ class TS(basetransdev):
|
||||
)
|
||||
self.currenttext = content
|
||||
currtext = ""
|
||||
while self.currenttext == content:
|
||||
time.sleep(0.01) # get text before violate usage policies.
|
||||
if self.tgtlang == "Arabic":
|
||||
|
||||
newcurr = self.getcurr(idx)
|
||||
if newcurr == currtext:
|
||||
continue
|
||||
yield newcurr[len(currtext) :]
|
||||
currtext = newcurr
|
||||
while self.currenttext == content:
|
||||
time.sleep(1) # get text before violate usage policies.
|
||||
|
||||
newcurr = self.getcurr(idx)
|
||||
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user