AI-generated Key Takeaways
-
MLKTranslatorOptions
configures the source and target languages for translation usingMLKTranslator
. -
It requires specifying both source and target languages during initialization using
initWithSourceLanguage:targetLanguage:
. -
Direct initialization using
init
is unavailable; always use the designated initializer. -
sourceLanguage
andtargetLanguage
properties provide read-only access to the configured language settings.
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;