AI-generated Key Takeaways
-
MLKTranslatorOptionsconfigures the source and target languages for translation usingMLKTranslator. -
It requires specifying both source and target languages during initialization using
initWithSourceLanguage:targetLanguage:. -
Direct initialization using
initis unavailable; always use the designated initializer. -
sourceLanguageandtargetLanguageproperties provide read-only access to the configured language settings.
MLKTranslatorOptions
@interface MLKTranslatorOptions : NSObjectOptions 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
sourceLanguageThe source language for the translator.
targetLanguageThe target language for the translator.
Return Value
A new instance of
TranslatorOptionswith the given source and target language. -
Unavailable. Use
init(sourceLanguage:targetLanguage:)instead.Declaration
Objective-C
- (nonnull instancetype)init;