ThioJoe / Auto-Synced-Translated-Dubs

Automatically translates the text of a video based on a subtitle file, and also uses AI voice to dub the video, and synced using the subtitle's timings
GNU General Public License v3.0
1.55k stars 152 forks source link

Implement DeepL translation #27

Closed sofiadparamo closed 1 year ago

sofiadparamo commented 1 year ago

Type of change

Proposed Changes

I've extensively tested everything in this PR, I tried to cover every path and possible way for the code to run, however, since this is a big change, it would be great to test it on an environment different than mine.

Additional Info

Checklist:

Required:

ThioJoe commented 1 year ago

Cool, I don't see any obvious issues, I should be able to fully test it out in the next couple days.

Since DeepL doesn't support as many languages as Google Translate, I can add some kind of fallback to use Google Translate in the case a language isn't supported, like Arabic, Hindi, Korean, etc. Should be easy enough to just hard code a list to check against.

sofiadparamo commented 1 year ago

Awesome!

It would also be possible to ask the API for the supported languages and do a dynamic fallback, that way it would stay updated with API changes on DeepL's side.

However, there are still some things that require attention, for example, the language en is no longer supported, only en-US or en-GB, the same applies to pt with pt-BR and pt-PT. I don't know why are they listed as backward support, but the library generates a deprecation exception when using those.

alani1 commented 1 year ago

That's awesome! We are using deepl to do translation of subtitles for Khan Academy, but actually run those then trough Amara.og with a manual review process. So probably will not be able to use the integration here.

Did you consider making the used translation service configurable in config.ini? E.g. change skip_translation = False to translation_service = { none, Google, Deepl}