Translation API released by Apple

Apple’s new translation API does not require networking and completely uses the native large language model.

Use a translation framework to provide in-application translation. You can use the built-in UI to have the system provide translations to users on your behalf. Or you can use the framework to customize the translation experience.

To provide a built-in system translation experience, anchor the view modifier to the SwiftUI view that contains the text you want to translate. Set isPresented to true when you want to display the built-in system translation UI. Pass the text to be translated to the text parameter.

To customize the translation experience, use one of the translation tasks, such as translationTask(_:action:). These functions provide you with a TranslationSession that you can use to translate text strings one at a time or in batches. You can check language availability before using the Language Availability class to provide translations.

Translate text in your application, display simple system translations and create a custom translation experience.

With the translation framework, you can provide in-application translation from one language to another. To display simple system translations in your application, use the Translation Overlay.

For a more customizable translation experience, use the TranslationSession object and its associated translation method. Through a customizable translation API, the framework asks users for permission to download language translation models if necessary. You can translate strings efficiently while checking language usability before providing translations.

This sample code project provides a TranslatingText sample application to demonstrate various methods of translating text. It consists of the following translation demonstrations:

Translate text, replace text, single string, one-time batch processing, batch processing as sequence, language support, prepare for translation

For more detailed information, you can read the original text, which can be found in the following link
Thank you for watching this video. If you like it, please subscribe and like it. thank

Related documents and sample code Translation: https://developer.apple.com/documentation/Translation
Translate text in your app: https://developer.apple.com/documentation/Translation/translating-text-within-your-app
Customize speech recognition on your device: https://developer.apple.com/videos/play/wwdc2023/10101

Oil tubing:

Scroll to Top