SethRobinson / UGT

Universal Game Translator - Uses Google's Cloud Vision to read and speak dialog from any image/game in any language
https://www.codedojo.com/?p=2426
Other
120 stars 24 forks source link

DeepL support #26

Closed jotumn closed 3 years ago

jotumn commented 3 years ago

Would be more efficient for something like a visual novel rather than use the game window instead.

Also are there any plans to add DeepL support?

jotumn commented 3 years ago

Oh, it looks like the selection is reused when you use the window mode. Never mind then.

jotumn commented 3 years ago

Another thing that comes to mind is copying the OCRed text into the Windows paste buffer - that way Translation Aggregator can grab it.

SethRobinson commented 3 years ago

I just noticed DeepL recently, I'd like to add support for that soon! Looks like it does a better job.

You can right click on a text block to copy it in the paste buffer - to copy the original text rather than the translation, hold the down arrow while right clicking. (Down arrow causes the pre-translated text to be shown)

jotumn commented 3 years ago

Oh yes, it's way better than Google. There's another program that I've been using before that has support for it, perhaps you can reuse some code from there - https://github.com/Artikash/Textractor

Thanks for the shortcuts, I'll check it out. But hopefully you could make a config setting to do it automatically to eliminate clicks.

Also, is there a way to log both untranslated and translated texts into files automatically?

SethRobinson commented 3 years ago

Deepl supported added in 0.69, please try it and let me know how it works for you. Seems to do a great job for me, although it seems to spit back results a bit slower than Google's stuff.

There is no auto logging of text. What formats would be useful? Timestamps? Translated/Untranslated listed together as pairs? Only "dialog" maybe? (if menu options were included it could get cluttered... although I guess if you're careful where you're scanning there wouldn't be menu options)

jotumn commented 3 years ago

Awesome, I'll check it out ASAP. IIRC, it lagged at certain times of day, they likely don't have as many servers as Google.

I'd prefer to log everything, with the format as simple as a line of untranslated text, then a line of translated, then an empty line. I can remove menu items by myself if necessary. Timestamps are not necessary.

jotumn commented 3 years ago

Okay, DeepL support works perfectly so far, thank you! I've also tried the down + right click to copy text to buffer. Automatic copying of source text into buffer through the config variable would really help here if it's not too much to ask :)

Also I have to ask why aren't using the Github releases?

SethRobinson commented 3 years ago

Thanks!

Logging - I'll probably add an option to do this in the next release Auto copy text into clipboard - I can add this as an option, similar to logging, might be a bit weird if a lot of text/menus are on the screen though (maybe I can do a general "left to right, up to down" type of sequence. Maybe an option to limit it to things determined to be "dialog" (green text)

Github release: Hmm, never really thought about it. I generally try not to use too many features of external sites - this way switching to something else is easy later. (for example, I used to have all my code on sourceforge... now I don't)

I did at least recently add a big download link in the front page readme though, so people don't have to read my blog to get the link.

Oh, and something I forgot to note anywhere else: If anyone tries to compile this themselves and has problem with DeepL support: You also need to update Proton SDK to the latest version, I made a tiny tweak there.

jotumn commented 3 years ago

Logging - I'll probably add an option to do this in the next release

Great, I'll be waiting :)

Auto copy text into clipboard - I can add this as an option, similar to logging, might be a bit weird if a lot of text/menus are on the screen though (maybe I can do a general "left to right, up to down" type of sequence. Maybe an option to limit it to things determined to be "dialog" (green text)

I've a feeling that you make a screenshot of the whole game screen and that's where these considerations come from :) Myself, I prefer to select the small area where the main game text goes (I did it immediately to speed up the screenshot upload process and reduced the JPG quality, too) so there's very little unnecessary text. When I play VNs, they tend to have all text in one place, and in the case of RPGs, there's no point in repeated translations of the UI.

I see your point on Github but it's a bit handier to follow fresh releases for projects, especially if you follow a lot of them - the Github releases page has RSS in it, so I tend to add all projects I follow to Feedly.

SethRobinson commented 3 years ago

Ok, this has been added (er, the text logging and auto putting it on the windows clipboard) and will be in the V0.70 release (soon?)

It's config.txt (well, config_template.txt) has this added:

;valid options for the below two settings are ;disabled (this means don't do anything) ;full (this means copy the pretranslated text boxes along with the translations (if any was done)) ;pre (this means only the pretranslated text) ;post (this means only the translated text, if any translation was done)

;The log file created is called translation_log.txt

log_capture_text_to_file|disabled place_capture_text_on_clipboard|disabled

jotumn commented 3 years ago

Excellent, will be waiting for the release!