<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 15.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Translation",
  "identifier" : "/documentation/Translation/TranslationSession/prepareTranslation()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Translation"
    ],
    "preciseIdentifier" : "s:11Translation0A7SessionC07prepareA0yyYaKF"
  },
  "title" : "prepareTranslation()"
}
-->

# prepareTranslation()

Asks for permission to download translation languages without doing any translations.

```
func prepareTranslation() async throws
```

## Discussion

If you know ahead of time which languages the person needs to translate,
you can prompt them to download those languages in advance by calling this method.

When you call this method, the framework asks the person for permission to download the
[`sourceLanguage`](/documentation/Translation/TranslationSession/sourceLanguage) and [`targetLanguage`](/documentation/Translation/TranslationSession/targetLanguage).
If the languages are already installed or in the middle of downloading, the function returns
without prompting them.

If you call this function when the `sourceLanguage` is `nil`, it throws
[`unableToIdentifyLanguage`](/documentation/Translation/TranslationError/unableToIdentifyLanguage) error, since there’s no sample text to
identify which source language to use for translation.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)