IceCubesApp icon indicating copy to clipboard operation
IceCubesApp copied to clipboard

Ability to manually choose the "translate from" language

Open LorenAmelang opened this issue 2 years ago • 7 comments

I often see wrong guesses by the Translate function, but this one was rather blatant:

DeepL 'Chinese'

I also follow a guy who posts in an obscure Catalan dialect, and the Translate function guesses wrong almost every time, choosing source languages from all over Europe, and printing a result identical to the original. Yes, his account specifies Catalan - apparently Translate ignores that. But it offers to translate English posts from people whose configured language is not English... How does this supposedly work?

I know there is a request for permanent config for specific posters, and that would be great, but the ability to manually override any individual post's "translate from" language would be a big improvement.

LorenAmelang avatar Oct 07 '23 20:10 LorenAmelang

The problem is, that the DeepL API seems to be pretty bad in recognizing a language. If the language is recognized wrong, it’s not possible to translate the text. That’s why the original text is shown again.

My server uses LibreTranslate, which seems to be pretty good in recognizing the language. The downside is, that the translation quality is in general worse than DeepL 😀.

blueturtleai avatar Oct 09 '23 14:10 blueturtleai

@blueturtleai Is there a way to select "your server"? Or does that mean the server for your Masto instance? How would it override what Ice Cubes defaults to?

There used to be two entries on the ... menu for each post - "Translate" and "Translate with DeepL". I never figured out the difference, and now I only see "Translate". The result it prints says DeepL...

LorenAmelang avatar Oct 09 '23 19:10 LorenAmelang

  • "Your Server" means his mastodon instance
  • We removed "Translate with DeepL" since someone complained that it's too confusing for the average user. We haven't changed the use of the "Translate"-Button. If your text is translated via DeepL and you haven't manually forced that in the settings by pasting your API key this is the translation service your mastodon instance provides. We send a request to your instance by default and can't select the translation service in that case.
  • If you use your server's translation service we can't manually select the source language, since that's not included in the mastodon API. This would however be possible with DeepL (AFAIK), so we might be able to add that selector for users which have selected DeepL specifically

Havhingstor avatar Oct 09 '23 20:10 Havhingstor

@Havhingstor Thanks for the real details! I have not entered a DeepL API key, so I guess my instances default to DeepL.

I'd certainly vote for adding a language selector option, and would be glad to enter an API key to support it.

Would it be possible to determine the poster's configured language, and send that to DeepL? Most of my translate failures are DeepL guessing wrong when the poster has correctly set what language they post in.

LorenAmelang avatar Oct 10 '23 00:10 LorenAmelang

That would probably be possible, however it also happen quite often that the poster has forgotten to change their language, so the posters language is not correct.

Havhingstor avatar Oct 10 '23 06:10 Havhingstor

tech team member of the instance OP is on - we don't have DeepL configured (or we didn't at the time, i'm setting it up now), but it looks like the request doesn't include source_lang : https://github.com/Dimillian/IceCubesApp/blob/8a49409b26c4a914bfddd19f46fe11a5986ba8fa/Packages/Network/Sources/Network/DeepLClient.swift#L51

whether that be from some dropdown as requested or specified by the OP.

DeepL's API allows it: https://github.com/DeepLcom/openapi/blob/c2afaff99f3e518cafda850782ca077703dba559/openapi.yaml#L128

so i haven't looked too deeply at the underlying code here but presuming one can get the source language from the post metadata roughly as easy as one can get the body text, then it should just be a line or three to add that field into the request.

sneakers-the-rat avatar Oct 27 '23 21:10 sneakers-the-rat

I also run into this issue with Hebrew. DeepL seems to think it's Czech.

Perhaps we can add Google Translate, or another service, instead?

(I am not familiar with how this tool is created or what settings are possible, I'm just suggesting).

Just-Care avatar Dec 06 '23 17:12 Just-Care