Here’s the fix: https://github.com/damus-io/damus/pull/998

Reply to this note

Please Login to reply.

Discussion

Thank you for your hard work. I just found this bug today and saw on GitHub that it has been fixed by you. Very efficient.👍

While using automatic translation, I found some other bugs, such as some content can not be translated, or the translation can not be displayed. And another issue, when Damus is relaunched, it will re-request the translation of the previously translated content. Can please you fix this?

> some content can not be translated, or the translation can not be displayed

Translations are always a guess and best effort. We could potentially add features to mitigate the issue, such as a setting to define your own language prediction minimum confidence level (currently 50%), or allow you to force translation from the language of choice.

> when Damus is relaunched, it will re-request the translation of the previously translated content

We also don’t cache the original notes when Damus is relaunched. If we want to go down the route of caching translations, we probably also want to cache the original notes. I’ll ask the Damus contributors what they think about that.

🤙👏

Is the guess random? Strangely, the same post is sometimes recognized as a need for translation, and sometimes it doesn‘t.

When switching pages, you will also see no translation, such as switching from the global to the homepage, but it does not always happen.

I think it is more necessary to cache the translation than the original text, because the API may be charged or the number of translations is limited.

The predicted language is provided by Apple’s natural language library, but it can be incorrect. That accounts for most of what you see in your experience using translations in Damus.

The other issue is that we don’t retry failed requests to fetch translations at the moment, which could improved on. Requests can transiently fail for a multitude of reasons.

Noted about caching translations. I’ll think on it more.

Thank you for your answer. With your efforts, Damus‘s translation function will become better and better.

Thanks bro ,great 🤙