With the announcement of the new Apple Translate app and offline support, are there any URL schemes that we can use in our apps to send text to the Translate app and have it open and translate the sent text?
Apple Translate App URL Scheme
i just find that enter translate:// in safari will show the open in translate prompt, but will not actually open the app.
This still hasn't been addressed. If anyone knows a way to open the Translate app via a link in SwiftUI, please let us know. As Alen stated above, using "translate://" only brings up a prompt and will not open the app.
Hi @ryrous, thanks for your interest in integrating with the Translate app.
While I'm not sure about a URL scheme to launch the app, if you're hoping to provide translation functionality in your app you have a few options:
- Allow users to use standard text selection in your app. Then they can select text, choose "Translate" and see a translation within your app.
- Adopt the
.translationPresentation()
API to programmatically invoke the translation UI described in #1. You can add a "Translate" button that triggers this and shows the UI to the user. There's even an option in that UI to "Open in Translate" if the user chooses to do so. - Have more control over translating text and displaying it within your app by adopting
.translationTask
and usingTranslationSession
APIs. This allows you to use the same translation engine as the Translate app from within your app, and display results however you'd like.
For more information see the WWDC session Meet the Translation API, or view the developer documentation about these APIs here: https://developer.apple.com/documentation/Translation