damus icon indicating copy to clipboard operation
damus copied to clipboard

Add Apple translation popovers for notes for iOS 17.4+ and macOS 14.4+

Open tyiu opened this issue 1 year ago • 5 comments

Changelog-Added: Add Apple translation popovers for notes for iOS 17.4+ and macOS 14.4+

https://github.com/damus-io/damus/assets/963907/4fdddb61-9cd0-4514-80fe-79298d9c92a6

Simulator Screenshot - iPhone 15 Pro - 2024-07-16 at 13 07 06 Medium

These changes are gated around iOS and macOS versions. If an older OS is being run, Apple translations won't be offered.

tyiu avatar Jun 21 '24 04:06 tyiu

@tyiu is it possible to set up auto translate using iOS offline translations? That is, remove the need to tap "translate note"

alltheseas avatar Jun 21 '24 04:06 alltheseas

@tyiu is it possible to set up auto translate using iOS offline translations? That is, remove the need to tap "translate note"

Technically yes, but only in iOS 18.0+

tyiu avatar Jun 21 '24 04:06 tyiu

very cool, will test this soon

jb55 avatar Jun 24 '24 23:06 jb55

There's a bug when damus_state.settings.auto_translate is set to true but Offline Translations is selected. It won't show the Translate button in that case, which is incorrect. I'll work on a fix, and also look into the auto translations with iOS 18.0.

tyiu avatar Jul 16 '24 02:07 tyiu

I mischaracterized the this PR. It's not exclusively offline note translations from Apple. The translation requests can still go to Apple servers, but can be offline as well via downloaded languages if there's network connectivity issues. I've updated the description, commit, and PR title accordingly

Note that the branch name says offline-translations, which is incorrect. But I didn't want to create a new PR just for the sake of a new branch name.

There's a bug when damus_state.settings.auto_translate is set to true but Offline Translations is selected. It won't show the Translate button in that case, which is incorrect. I'll work on a fix, and also look into the auto translations with iOS 18.0

I fixed the bug that I reported in my previous comment.

tyiu avatar Jul 16 '24 17:07 tyiu

I rebased this branch on the latest master and force pushed. No other changes were made.

tyiu avatar Sep 22 '24 18:09 tyiu