One Logo Pool Ball
Translation · IOS API REFERENCE

TranslationError

struct · iOS 18.0+ · SDK 27.1

struct TranslationError

Error codes describing why the framework can't perform a translation.

Members (10)

get · iOS 18.0+

internalError

TypeScript
static get internalError(): TranslationError
Swift declaration
static let internalError: TranslationError

An error occurred internal to the translation engine.

get · iOS 26.0+

notInstalled

TypeScript
static get notInstalled(): TranslationError
Swift declaration
static let notInstalled: TranslationError

The device doesn't have the necessary languages downloaded to perform a translation and the session can't request the person to download them. This error is thrown if <doc://com.apple.documentation/documentation/translation/translationsession/canrequestdownloads> is false and either the languages are supported but the person hasn't approved them or if the person has approved them but the languages haven't finished downloading.

get · iOS 18.0+

failureReason

TypeScript
get failureReason(): (string) | null
Swift declaration
var failureReason: String? { get }

A localized message describing the reason for the failure.

get · iOS 26.0+

alreadyCancelled

TypeScript
static get alreadyCancelled(): TranslationError
Swift declaration
static let alreadyCancelled: TranslationError

An error describing a translation session that you've cancelled before, which prevents the session from producing additional results. A ``TranslationSession`` instance throws this error when you call one of its translate methods after calling its ``TranslationSession/cancel()`` method.

get · iOS 18.0+

errorDescription

TypeScript
get errorDescription(): (string) | null
Swift declaration
var errorDescription: String? { get }

A localized message describing the error.

get · iOS 18.0+

nothingToTranslate

TypeScript
static get nothingToTranslate(): TranslationError
Swift declaration
static let nothingToTranslate: TranslationError

No content to translate.

get · iOS 18.0+

unableToIdentifyLanguage

TypeScript
static get unableToIdentifyLanguage(): TranslationError
Swift declaration
static let unableToIdentifyLanguage: TranslationError

The framework can't identify the source language automatically. The framework throws this error when you call ``TranslationSession/prepareTranslation()`` without specifying the source language, or when using ``LanguageAvailability/status(for:to:)`` and it can't automatically identify the source language of the sample text you pass in. > Note: For best results in automatic language detection, pass in a sample string of at least 20 characters in length.

get · iOS 18.0+

unsupportedSourceLanguage

TypeScript
static get unsupportedSourceLanguage(): TranslationError
Swift declaration
static let unsupportedSourceLanguage: TranslationError

The framework doesn't support the specified or detected source language.

get · iOS 18.0+

unsupportedTargetLanguage

TypeScript
static get unsupportedTargetLanguage(): TranslationError
Swift declaration
static let unsupportedTargetLanguage: TranslationError

The framework doesn't support the specified or chosen target language.

get · iOS 18.0+

unsupportedLanguagePairing

TypeScript
static get unsupportedLanguagePairing(): TranslationError
Swift declaration
static let unsupportedLanguagePairing: TranslationError

The framework doesn't support the specified source and target language pairing. The framework doesn't support translating from and to the same language. For example, you can't translate from English (US) to English (UK) or from French to French.

Skipped declarations

No declarations were skipped in this snapshot.

All Translation types →