testing library

Test support for code that uses apple_translation.

Replace TranslationBindings.instance with bindings backed by fake host APIs to exercise the Dart layer without a device.

Classes

AppleTranslationCallbackApi
Native -> Dart.
AppleTranslationHostApi
Registered only when the framework is available (iOS 18 / macOS 15).
AppleTranslationPlatformApi
Always available.
BatchSink
Receives the events of one streaming batch request.
ErrorMessage
An error delivered through the callback API.
LanguageMessage
A resolved Locale.Language.
SessionInfoMessage
A newly created TranslationSession.
TextSegmentMessage
A run of text, optionally marked with the skipsTranslation attribute.
TranslationBindings
The platform APIs the apple_translation library talks to.
TranslationRequestMessage
Mirrors TranslationSession.Request.
TranslationResponseMessage
Mirrors TranslationSession.Response.

Enums

LanguageStatusMessage
Mirrors LanguageAvailability.Status.
StrategyMessage
Mirrors TranslationSession.Strategy (iOS 26.4 / macOS 26.4).

Functions

wrapResponse({Object? result, PlatformException? error, bool empty = false}) → List<Object?>