Tool jDeppL - A DeepL clipboard hook [v2.3.3]

Nov 26, 2016
203
466
Hey asdasfa9 , is there any fix or setting in the config that won't break a translation attempt with many periods? Not at my desktop to post an example but say for instance the original text window is "......jptext....jptext.........jptext............." then the translation window ends up showing ".............................................................[dot]"

A ctrl+r doesn't recapture it so the only way I've been able to get around it is highlighting the actual kanji bit by bit avoiding the periods. Not a game breaker at all but a bit annoying for the majority of h scenes obvs.

Edit: In case that doesn't make sense, I'll post an example later.
 

jambonblanc

New Member
Nov 21, 2017
3
1
Hey asdasfa9 , is there any fix or setting in the config that won't break a translation attempt with many periods? Not at my desktop to post an example but say for instance the original text window is "......jptext....jptext.........jptext............." then the translation window ends up showing ".............................................................[dot]"
I think your best bet is to make use of the substitution file, and add a couple lines under the precopyregex :
"・・・・・・・・" = "..."
"・・・・・・・" = "..."
"・・・・・・" = "..."
"・・・・・" = "..."
"・・・・" = "..."
And add more if your game uses more periods than that.
That way deepl won't get flooded by periods and it should hopefully break the translation less. At least that's what I've done and it seems to work for the most part on my end.
 
  • Like
Reactions: brutusbeefcake

asdasfa9

Member
Jul 2, 2018
145
381
You can also do it like this:
Under [precopyregex] or [preregx]
"\\.{4,}" = "..."
This will replace all 4 or more consecutive periods with just 3 periods.

Edit: 4 periods, use 4 instead.
 
Last edited:

asdasfa9

Member
Jul 2, 2018
145
381
Updated

v2.3.3
:
- Just a correction in the substitutions files. [preregx] should be [preregex], with an "e" before x.
 

corndoggie117

New Member
Dec 29, 2020
2
0
I'm pretty sure you get unlimited requests with an API key, and probably faster too.
Nah Dev API key version is paid per character, it's like $10 if you hit 250,000. So, in your experience the web version of DeepL has a pretty substantial cap per day? Does it have any speed limit per translation request?
 

asdasfa9

Member
Jul 2, 2018
145
381
Nah Dev API key version is paid per character, it's like $10 if you hit 250,000. So, in your experience the web version of DeepL has a pretty substantial cap per day? Does it have any speed limit per translation request?
I don't really know, I've only hit the cap once, it's an undisclosed amount, they probably track how often and how large your requests are and base it around that. Rebooting router (if dynamic) for a new IP worked around that.
As for speed, I assume the site is slower compared to direct requests, but I don't really know.
This application isn't built around having an API key though and can't utilize one.
 

-FibaG-

Member
Nov 9, 2018
282
470
Untitled.jpg

Last version of jdeppL 2.3.3 have a bug not everytime just sometimes appear this [JTld][JTld] it's effect and change automatically the translation when this happen....


Untitled2.jpg

Without the "[JTld][JTld]" translation is like this.
 

asdasfa9

Member
Jul 2, 2018
145
381
Last version of jdeppL 2.3.3 have a bug not everytime just sometimes appear this [JTld][JTld] it's effect and change automatically the translation when this happen....
It's the substitutions, it's just there to try to keep symbols like the tilde in the output.
You can remove it if you want, in the substitutions folder, edit Default.toml. Remove "~" = "[JTld]" and "~" = "[Tld]" under [pre].
 
Last edited:

-FibaG-

Member
Nov 9, 2018
282
470
It's the substitutions, it's just there to try to keep symbols like the tilde in the output.
You can remove it if you want, in the substitutions folder, edit Default.toml. Remove "~" = "[JTld]" and "~" = "[Tld]" under [pre].
Can I put space when that symbol appear? I think it work more well with space(blank) what do you think?
 

Doomjester123

New Member
Aug 31, 2020
8
4
Hi, I use this on my other laptop but somehow it always skips text. Like A *work*, B *not working*, C*work*, D*not working*. The Textractor detect the text but this app doesn't seem to detect the text in instance B and D.
 

asdasfa9

Member
Jul 2, 2018
145
381
Hi, I use this on my other laptop but somehow it always skips text. Like A *work*, B *not working*, C*work*, D*not working*. The Textractor detect the text but this app doesn't seem to detect the text in instance B and D.
Make sure monitorClipboard is enabled, also try setting useClipboardPolling to true in the config.toml.
 

Doomjester123

New Member
Aug 31, 2020
8
4
Make sure monitorClipboard is enabled, also try setting useClipboardPolling to true in the config.toml.
Umm yea, now the app appear to detect the text but not sending it to the browser. Now it's A *working*, B*detect not send*, C*detect not send* tranlating.... on window, D*working*, E *detect not send*, F*detect not send* translating... on window and back to "working"
 
Last edited:

asdasfa9

Member
Jul 2, 2018
145
381
Umm yea, now the app appear to detect the text but not sending it to the browser. Now it's A *working*, B*detect not send*, C*detect not send* tranlating.... on window, D*working*, E *detect not send*, F*detect not send* translating... on window and back to "working"
Try setting useOutputPolling to true too.
If you still have issues, you might want to check this out instead.
 

MuninKai

Well-Known Member
Apr 29, 2020
1,631
2,642
Made something similar for myself in Python and selenium, and was wondering how you were pulling the output from DeepL? I got stuck using the copy to clipboard button on the website, and was wondering if there was a more efficient way to do it?
 

asdasfa9

Member
Jul 2, 2018
145
381
Made something similar for myself in Python and selenium, and was wondering how you were pulling the output from DeepL? I got stuck using the copy to clipboard button on the website, and was wondering if there was a more efficient way to do it?
You can read the output by getting the "value" attribute of the element with the class name "lmt__target_textarea".
There's no efficient out-of-the-box way for detecting an element change though, so I have mine either keep waiting for the value to change, or just simply poll for any changes on the element.
 
  • Love
Reactions: MuninKai

MuninKai

Well-Known Member
Apr 29, 2020
1,631
2,642
You can read the output by getting the "value" attribute of the element with the class name "lmt__target_textarea".
There's no efficient out-of-the-box way for detecting an element change though, so I have mine either keep waiting for the value to change, or just simply poll for any changes on the element.
That helps immensely, thank you! I just have it on a while output='' wait loop, so no change there, but allowing it to run in the background without having to remember I can't use my clipboard will make this a lot easier for doing big projects.
 
Mar 29, 2018
49
17
I'm sorry if this is a stupid question but, what is the difference between this and just using the DeepL extension from Textractor? Does it mean I can translate with DeepL an unlimited amount of times without getting a timeout even if I don't buy one of their subscriptions? Again, sorry if it's a dumb question(I'm new to all this text hooker stuff and machine translations in general).
 
Last edited: