MLKitTranslate Framework Reference

MLKTranslatorOptions


@interface MLKTranslatorOptions : NSObject

Options for Translator.

  • The source language of the input.

    Declaration

    Objective-C

    @property (nonatomic, readonly) MLKTranslateLanguage _Nonnull sourceLanguage;
  • The target language to translate the input into.

    Declaration

    Objective-C

    @property (nonatomic, readonly) MLKTranslateLanguage _Nonnull targetLanguage;
  • Creates a new instance of translator options with the given source and target languages.

    Declaration

    Objective-C

    - (nonnull instancetype)
        initWithSourceLanguage:(nonnull MLKTranslateLanguage)sourceLanguage
                targetLanguage:(nonnull MLKTranslateLanguage)targetLanguage;

    Parameters

    sourceLanguage

    The source language for the translator.

    targetLanguage

    The target language for the translator.

    Return Value

    A new instance of TranslatorOptions with the given source and target language.

  • Unavailable. Use init(sourceLanguage:targetLanguage:) instead.

    Declaration

    Objective-C

    - (nonnull instancetype)init;