elk icon indicating copy to clipboard operation
elk copied to clipboard

Translation missing from some posts but not others

Open dalekcoffee opened this issue 2 years ago • 8 comments

Hello!,

My primary language is English, but I follow many Japanese accounts on Mastodon.

One of my favorite features on elk.zone is the translate feature.

It appears that sometime this afternoon, translations are not appearing on posts, or not as often. If I scroll back to an earlier point in my feed I can see posts with translation available, but newer posts do not.

This appears to be true both on a desktop web browser, as well as a mobile web browser.

Specifically using Brave browser on both. Shields disabled.

I have gone ahead and cleared both cookies and cached data, it did not help the issue

Also tried vanilla chrome for windows, also not working.

App version [v0.7.1]

dalekcoffee avatar Feb 03 '23 19:02 dalekcoffee

Solve in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

stackblitz[bot] avatar Feb 03 '23 19:02 stackblitz[bot]

This can happen, when the post which seems to be japanese has set the language to english. Then Elk's translation feature will not trigger, because the author tells explicitely that this is an english post. This can explain why you see the translation on some posts but not on others. Maybe you can provide a link to a post where you don't see a translation to confirm this theory :)

niklaswolf avatar Feb 12 '23 11:02 niklaswolf

That's for sure the source of this issue. What we could probably do is detecting the language automatically. But your issue will still an issue for other web client which won't follow that feature (if implemented).

edimitchel avatar Feb 15 '23 14:02 edimitchel

If I use Norwegian, Spanish, German and French to try to test this with 'this is a test to see if translation's working', if the language of the post is set to English, no translation.

If I set the language of the post to Russian, translation link is provided. Logically, setting a post's default language to anything other than English will trigger translation.

Looks like the default for any post is English. Yes, it's a commonly used language, but there oughta be some way to alert users to set their post language to something other than English to trigger translation. That's not exactly a bug, but it is a feature that needs a serious tweak.

Servelan avatar Jul 23 '23 17:07 Servelan

@Servelan did you provide the languages you speak/understand in the language settings of elk? You can choose all languages you speak and for all posts that have set one of those languages, the translation is provided. The target translation language is determined by your user-interface language setting (also see in the language section of the settings). So all translations will translate to that language (if available in the translation service, the fallback is English).

Lastly, I provided a PR to set the default posting language to the one configured in the mastodon profile. Right now, the default for that was also the configured user-interface language

niklaswolf avatar Jul 29 '23 11:07 niklaswolf

I am a default English speaker, so I left it at the default. It is not a matter of what things translate to. Is is the fact that translation does not occur if the default language of a post is English. I have no idea what a 'PR' is but what you did will make no difference if the user's language default is English.

Servelan avatar Jul 29 '23 15:07 Servelan

@Servelan sorry for assuming that you're familiar with developer-terms, my bad. I tested this in my feed:

  • set the language to English
  • searched for a post in my feed other than english
  • saw the translation to English (in this example from German)
Bildschirmfoto 2023-07-29 um 18 18 57

Also I tried the other way round:

  • set my language to German
  • searched for a post in English
  • saw the translation to German Bildschirmfoto 2023-07-29 um 18 21 00

Maybe you can provide a link to a post where this is not working for you?

niklaswolf avatar Jul 29 '23 16:07 niklaswolf

The translate function seems not work all the time... My language setting is Chinese, but when I tried viewing posts via Elk, all posts shows in their original language. Screenshot 2024-04-17 224320

alrcatraz avatar Apr 17 '24 14:04 alrcatraz