Page Summary
-
TranslatorOptionsprovides configuration for theTranslatorclass, focusing on language settings. -
It requires specifying the
sourceLanguagefor input and the desiredtargetLanguagefor translation. -
The primary way to create
TranslatorOptionsis using the designated initializerinit(sourceLanguage:targetLanguage:). -
Directly calling
init()is unavailable; you must explicitly define source and target languages during initialization.
TranslatorOptions
class TranslatorOptions : NSObjectOptions for Translator.
-
The source language of the input.
Declaration
Swift
var sourceLanguage: TranslateLanguage { get } -
The target language to translate the input into.
Declaration
Swift
var targetLanguage: TranslateLanguage { get } -
Creates a new instance of translator options with the given source and target languages.
Declaration
Swift
init(sourceLanguage: TranslateLanguage, targetLanguage: TranslateLanguage)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.