MLKitTranslate Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
MLKTranslateRemoteModel
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
Objective-C
+ (nonnull MLKTranslateRemoteModel *)translateRemoteModelWithLanguage:
(nonnull MLKTranslateLanguage)language;
Return Value
A TranslateRemoteModel
instance.
-
Unavailable. Use translateRemoteModel(language:)
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."],[[["`MLKTranslateRemoteModel` is a translation model stored on a server and downloaded to the device for use."],["It is associated with a specific language, accessible via the `language` property."],["Instances should be created using `translateRemoteModelWithLanguage:`, specifying the desired language."],["Downloading the model triggers a `RemoteModel` notification, verifiable through the `ModelDownloadUserInfoKeyRemoteModel` field."],["Direct initialization with `init` is not allowed; use the provided factory method instead."]]],["The `MLKTranslateRemoteModel` is a remotely stored translation model downloaded to a device. Each model is associated with a specific language, accessible via the `language` property. Instances are created using `translateRemoteModelWithLanguage:`, which takes a language parameter. This model leverages `ModelManager` for downloads, triggering notifications for `RemoteModel`. You can check if a notification is a `TranslateRemoteModel`. Initialization using `init` is unavailable. Built-in models such as `TranslateLanguage.english` are not downloadable.\n"]]