AVIV Group Nov 19, 2024

iOS 18: Apple's Translation API

This article covers iOS 18 Release notes

Article Summary

activesludge breaks down iOS 18's Translation API with real-world demos that show how to eliminate copy-paste translation workflows. This is the most practical guide I've seen for implementing on-device translation.

Apple's new Translation API in iOS 18 lets developers embed translation directly into their apps with both system UI overlays and custom implementations. The author built a complete demo app showcasing legal disclaimers, real estate listings, contact forms, and surveys—all with in-app translation that works entirely on-device.

Key Takeaways

Critical Insight

iOS 18's Translation API makes on-device translation trivial to implement, but requires iOS 18+ and careful handling of language pack downloads and app dependencies.

The article reveals an unexpected behavior about how the API determines target languages that could trip up your implementation if you're not careful.

About This Article

Problem

Developers didn't know how the Translation API would behave on different devices. activesludge found that custom UI features fail silently when Apple's Translate app isn't installed, but there's no way to check if the app is available before trying to use it.

Solution

activesludge built a demo project on GitHub with three implementation categories: System UI, Custom UI, and Availability checks. It includes code examples for translating single strings, batch processing, and sequential translation using TranslationSession and LanguageAvailability classes.

Impact

The guide shows that default configuration auto-detects the source language and targets the user's region or preferred language. Developers can implement on-device translation with minimal code. Language pack downloads need internet the first time, but after that there's no dependency on translation services.