Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
Adds a "Translate" button to the dictionary search toolbar (next to Furigana) that sends the current context sentence directly to iOS's built-in Translate sheet, in one tap — no need to switch to Edit mode, manually select all the text, and choose Translate from the contextual menu.
This follows up on the request in #61.
Why this approach
Rather than introducing a new machine-translation engine, this reuses Apple's own system Translate sheet — the same one already reachable today via Edit mode → select text → Translate from the contextual menu. It's just skipping the manual-selection step. No new translation dependency, no new UI surface to maintain.
Behavior notes
.translationPresentationis unavailable at compile time under Mac Catalyst, and unreliable under "Designed for iPad." Rather than ship something half-working, the button is hidden on Mac entirely. Happy to revisit Mac support in a follow-up if there's interest.Testing
Tested on iPad Simulator and a physical iPad, with real dictionary content (Jitendex + SudachiDict tokenizer) imported, across both the normal display and in-progress-edit cases.