deep-translator icon indicating copy to clipboard operation
deep-translator copied to clipboard

Get the source language when translating with "auto" on Google Translate

Open PlugNPush opened this issue 10 months ago • 1 comments

I need to know what the original language was for the text that got translated over Google Translate, could this be added to this library?

Something like .translate_with_metadata() returning both the text and source language, and maybe even some extra data if the Google Translate API gives them to you.

My previous library for translation used to do this and got abandoned (googletrans), I would appreciate having it here.

PlugNPush avatar Apr 17 '24 12:04 PlugNPush

It looks like the website used to provide Google Translate translation does not display information about what language has been automatically detected. It's displayed on the main Google Translate website but there this information is obfuscated in the webpage source, so it'll be way more complicated to scrape that information.

I've tried to implement that, but I felt like I had to create the new translator scraper from scratch.

tomekrzymyszkiewicz avatar May 28 '24 18:05 tomekrzymyszkiewicz