Contents

prepareTranslation()

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

Declaration

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 and 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 error, since there’s no sample text to identify which source language to use for translation.

See Also

Preparing for translation