nidhaloff / deep-translator

A flexible free and unlimited python tool to translate between different languages in a simple way using multiple translators.
https://deep-translator.readthedocs.io/en/latest/?badge=latest
Apache License 2.0
1.61k stars 185 forks source link

Bug? GoogleTranslator does not translate things site does (japanese in english letters?) #184

Closed Gh0sTG0 closed 1 year ago

Gh0sTG0 commented 1 year ago

Description

Translating some number of things to understand what they are about.

Most of times translator works as it will on site page. If I give it line like "とろけるほど長い夜と月を君に" it will translate it and give me result exact the same as site page will do ("A long night and the moon that melts in your heart", looks like both examples are some love story, just some random thing I find in net and used as part of my test lines).

For example of how it is not working I'll use this line: "Torokeru Hodo Nagai Yoru to Tsuki o Kimi ni".

When I'm giving it to: the_line = "Torokeru Hodo Nagai Yoru to Tsuki o Kimi ni" translated = GoogleTranslator(source='auto', target='en').translate(the_line) print(translated) It returns me exact the same line: "Torokeru Hodo Nagai Yoru to Tsuki o Kimi ni" image

When I'm translating it through google translate site page (settings are auto->en), it gives me that it's Japanese, and translates it to "To you with a long night that melts away". image

Is there some way to fix that? Maybe some setting I need to set?

nidhaloff commented 1 year ago

@Gh0sTG0 Thanks for reaching out. Unfortunately, this cannot be fixed because the API that deep-translator is using, is in fact different from the google translate API. I guess the official Google translate is smart enough to check that it is Japanese, although it is written in English alphabets, but the API that deep-translator is using (which is for the google mobile api and unofficial anyway) does not have this feature.

Since this issue cannot be fixed and not related directly to the implementation, I'm going to close the issue.

Gh0sTG0 commented 1 year ago

@nidhaloff Thanks for your answer and work on this translator. Hope sometimes there will be some way to... maybe at least mark such things somehow.

nidhaloff commented 1 year ago

@Gh0sTG0 If you have time and passion to work on this, feel free to do it. Maybe you will find a way. I would happily review your work and merge it into deep-translator ;)

Gh0sTG0 commented 1 year ago

@Gh0sTG0 If you have time and passion to work on this, feel free to do it. Maybe you will find a way. I would happily review your work and merge it into deep-translator ;)

I'll try to explore something... but not today, long long long work day =) Maybe if sometimes I'll have success I'll share it =)