MLKitTranslate Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
TranslateRemoteModel
A translate model that is stored remotely on the server and downloaded on the device.
-
The language associated with this model.
-
Gets an instance of TranslateRemoteModel
configured with the given language.
This model can be used to trigger a download by calling download(_:)
API
from ModelManager
.
TranslateRemoteModel
uses ModelManager
internally. When downloading
a TranslateRemoteModel
, there will be a notification posted for a RemoteModel
.
To verify if such notifications belong to a TranslateRemoteModel
, check
that the ModelDownloadUserInfoKeyRemoteModel
field in the user info dictionary
contains an object of type TranslateRemoteModel
. Please do not instantiate
with TranslateLanguage.english
given it is built-in. Otherwise such instance
cannot be downloaded or deleted.
Declaration
Swift
class func translateRemoteModel(language: TranslateLanguage) -> TranslateRemoteModel
Return Value
A TranslateRemoteModel
instance.
-
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\u003eTranslateRemoteModel\u003c/code\u003e is a class representing a translation model stored remotely and downloaded for use on the device.\u003c/p\u003e\n"],["\u003cp\u003eIt is associated with a specific language and managed using the \u003ccode\u003eModelManager\u003c/code\u003e class.\u003c/p\u003e\n"],["\u003cp\u003eUse \u003ccode\u003etranslateRemoteModel(language:)\u003c/code\u003e to get an instance and trigger a download instead of directly initializing it.\u003c/p\u003e\n"],["\u003cp\u003eBuilt-in languages (like English) cannot be downloaded or deleted.\u003c/p\u003e\n"]]],[],null,["# MLKitTranslate Framework Reference\n\nTranslateRemoteModel\n====================\n\n class TranslateRemoteModel : ../Classes/RemoteModel.html\n\nA translate model that is stored remotely on the server and downloaded on the device.\n- `\n ``\n ``\n `\n\n ### [language](#/c:objc(cs)MLKTranslateRemoteModel(py)language)\n\n `\n ` \n The language associated with this model. \n\n #### Declaration\n\n Swift \n\n var language: ../Type-Definitions.html#/c:MLKTranslateLanguage.h@T@MLKTranslateLanguage { get }\n\n- `\n ``\n ``\n `\n\n ### [translateRemoteModel(language:)](#/c:objc(cs)MLKTranslateRemoteModel(cm)translateRemoteModelWithLanguage:)\n\n `\n ` \n Gets an instance of `TranslateRemoteModel` configured with the given language.\n This model can be used to trigger a download by calling `download(_:)` API\n from [ModelManager](../Classes/ModelManager.html).\n\n `TranslateRemoteModel` uses [ModelManager](../Classes/ModelManager.html) internally. When downloading\n a `TranslateRemoteModel`, there will be a notification posted for a [RemoteModel](../Classes/RemoteModel.html).\n To verify if such notifications belong to a `TranslateRemoteModel`, check\n that the `ModelDownloadUserInfoKeyRemoteModel` field in the user info dictionary\n contains an object of type `TranslateRemoteModel`. Please do not instantiate\n with `TranslateLanguage.english` given it is built-in. Otherwise such instance\n cannot be downloaded or deleted. \n\n #### Declaration\n\n Swift \n\n class func translateRemoteModel(language: ../Type-Definitions.html#/c:MLKTranslateLanguage.h@T@MLKTranslateLanguage) -\u003e TranslateRemoteModel\n\n #### Parameters\n\n |------------------|---------------------|\n | ` `*language*` ` | The given language. |\n\n #### Return Value\n\n A `TranslateRemoteModel` instance.\n- `\n ``\n ``\n `\n\n ### [-init](#/c:objc(cs)MLKTranslateRemoteModel(im)init)\n\n `\n ` \n Unavailable. Use [translateRemoteModel(language:)](../Classes/TranslateRemoteModel.html#/c:objc(cs)MLKTranslateRemoteModel(cm)translateRemoteModelWithLanguage:) instead."]]