Use of Apples Thesaurus & Translator

Hey,

I’m wondering if it’s possible to use the Translation service by Apple when selecting text like it’s possible in safari or other apps developed by apple. For example in notes or others you can select text and hit the translate button, which shows the translation to the systems language as far as I know. My question now is if it is possible to also provide this feature in my own app. To be more specific, having a selectable text view , then being able to translate this wording and maybe even get the results not only shown to the user himself but returning the translation to my own app for further processes …

as far as I know, the standard dictionary entries are provided by Oxford or in Germany by Duden api services. Is it even possible to the app to choose which service to use and another question: is it possible to customize the options popping up when text is selected? (The view where also “copy”,”paste”,”cut”…. Is shown -> extend options with “translate”?

Many thanks for your help. Unfortunately, I haven’t found an answer to those questions. My only thought has been to use external api by Oxford etc but first I would like to be in knowledge of the possibility or unavailability of the given service already implemented by apple to iOS and macOS devices.

Have a great day. À bientôt

Answered by fredfaulig in 715550022

I just searched a little more through the World Wide Web and found some first interesting resources that may fit my initial „needs / demands“

Official Apple Doc uireferencelibraryviewcontroller

There are also brief tutorials out there, which show how to use this functionality of UIkit. (Since I’m relatively new to swiftui and apples developer scene I didn’t know that sharing a specific url is not supported, but there are some tutorials introducing uireferencelibraryviewcontroller).

Your app should have translate capabilities automatically if you use standard system views and controls.

Otherwise, you have to be very careful with other companies' apps and services. You might not be legally allowed to use those services or data inside your own app.

Accepted Answer

I just searched a little more through the World Wide Web and found some first interesting resources that may fit my initial „needs / demands“

Official Apple Doc uireferencelibraryviewcontroller

There are also brief tutorials out there, which show how to use this functionality of UIkit. (Since I’m relatively new to swiftui and apples developer scene I didn’t know that sharing a specific url is not supported, but there are some tutorials introducing uireferencelibraryviewcontroller).

Any public Apple API would work. The key part is what it is being used for. If you are showing it to the user for use inside your app, then Apple encourages this use. You just have to be careful with the part about "returning the translation to my own app for further processes".

I'm not sure what you mean about sharing specific URLs. I think there is a restriction of non-Apple URLS. You can use them, you just have to use the official "link" tool and make sure that the text and URL are both the URL. That way people can easily see that the URL is a non-Apple site. But it is always better to share official Apple URLs anyway. 3rd party sites are often old and incorrect.

Use of Apples Thesaurus & Translator
 
 
Q