MLKitTranslate Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
MLKTranslatorOptions
@interface MLKTranslatorOptions : NSObject
Options for Translator
.
-
The source language of the input.
-
The target language to translate the input into.
-
Creates a new instance of translator options with the given source and target languages.
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;
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-07-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-07-10 UTC."],[[["\u003cp\u003e\u003ccode\u003eMLKTranslatorOptions\u003c/code\u003e configures the source and target languages for translation using \u003ccode\u003eMLKTranslator\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eIt requires specifying both source and target languages during initialization using \u003ccode\u003einitWithSourceLanguage:targetLanguage:\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eDirect initialization using \u003ccode\u003einit\u003c/code\u003e is unavailable; always use the designated initializer.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003esourceLanguage\u003c/code\u003e and \u003ccode\u003etargetLanguage\u003c/code\u003e properties provide read-only access to the configured language settings.\u003c/p\u003e\n"]]],[],null,["# MLKitTranslate Framework Reference\n\nMLKTranslatorOptions\n====================\n\n\n @interface MLKTranslatorOptions : NSObject\n\nOptions for `Translator`.\n- `\n ``\n ``\n `\n\n ### [sourceLanguage](#/c:objc(cs)MLKTranslatorOptions(py)sourceLanguage)\n\n `\n ` \n The source language of the input. \n\n #### Declaration\n\n Objective-C \n\n @property (nonatomic, readonly) ../Type-Definitions.html#/c:MLKTranslateLanguage.h@T@MLKTranslateLanguage _Nonnull sourceLanguage;\n\n- `\n ``\n ``\n `\n\n ### [targetLanguage](#/c:objc(cs)MLKTranslatorOptions(py)targetLanguage)\n\n `\n ` \n The target language to translate the input into. \n\n #### Declaration\n\n Objective-C \n\n @property (nonatomic, readonly) ../Type-Definitions.html#/c:MLKTranslateLanguage.h@T@MLKTranslateLanguage _Nonnull targetLanguage;\n\n- `\n ``\n ``\n `\n\n ### [-initWithSourceLanguage:targetLanguage:](#/c:objc(cs)MLKTranslatorOptions(im)initWithSourceLanguage:targetLanguage:)\n\n `\n ` \n Creates a new instance of translator options with the given source and target languages. \n\n #### Declaration\n\n Objective-C \n\n - (nonnull instancetype)\n initWithSourceLanguage:(nonnull ../Type-Definitions.html#/c:MLKTranslateLanguage.h@T@MLKTranslateLanguage)sourceLanguage\n targetLanguage:(nonnull ../Type-Definitions.html#/c:MLKTranslateLanguage.h@T@MLKTranslateLanguage)targetLanguage;\n\n #### Parameters\n\n |------------------------|-----------------------------------------|\n | ` `*sourceLanguage*` ` | The source language for the translator. |\n | ` `*targetLanguage*` ` | The target language for the translator. |\n\n #### Return Value\n\n A new instance of `TranslatorOptions` with the given source and target language.\n- `\n ``\n ``\n `\n\n ### [-init](#/c:objc(cs)MLKTranslatorOptions(im)init)\n\n `\n ` \n Unavailable. Use `init(sourceLanguage:targetLanguage:)` instead. \n\n #### Declaration\n\n Objective-C \n\n - (nonnull instancetype)init;"]]