Name Description Size
DetectedLanguages.kt The representation of a translations detected document and user language. @property documentLangTag The auto-detected language tag of page. Usually used for determining the best guess for translating "from". @property supportedDocumentLang If the translation engine supports the document language. @property userPreferredLangTag The user's preferred language tag. Usually used for determining the best guess for translating "to". 879
Language.kt The language container for presenting language information to the user. @property code The BCP 47 code that represents the language. @property localizedDisplayName The translations engine localized display name of the language. 598
LanguageModel.kt The language model container for representing language model state to the user. Please note, a single LanguageModel is usually comprised of an aggregation of multiple machine learning models on the translations engine level. The engine has already handled this abstraction. @property language The specified language the language model set can process. @property status The download status of the language models, which can be not downloaded, download processing, or downloaded. @property size The size of the total model download(s). 8951
LanguageSetting.kt The preferences setting a given language may have on the translations engine. @param languageSetting The specified language setting. 4199
ModelManagementOptions.kt The operations that can be performed on a given language model. @property languageToManage The BCP 47 language code to manage the models for. May be null when performing operations not at the "language" scope or level. @property operation The operation to perform. @property operationLevel At what scope or level the operations should be performed at. 791
ModelOperation.kt The operations that can be performed on a language model. 676
ModelState.kt The current state or status of a language model. 970
OperationLevel.kt The level or scope of a model operation. 882
TranslationDownloadSize.kt A data class to contain information related to the download size required for a given translation to/from pair. For the translations engine to complete a translation on a specified to/from pair, first, the necessary ML models must be downloaded to the device. This class represents the download state of the ML models necessary to translate the given to/from pair. @property fromLanguage The [Language] to translate from on a given translation. @property toLanguage The [Language] to translate to on a given translation. @property size The size of the download to perform the translation in bytes. Null means the value has yet to be received or an error occurred. Zero means no download required or else a model does not exist. @property error The [TranslationError] reported if an error occurred while fetching the size. 1297
TranslationEngineState.kt The representation of the translations engine state. @property detectedLanguages Detected information about preferences and page information. @property error If an error state occurred or an error was reported. @property isEngineReady If the translation engine is primed for use or will need to be loaded. @property hasVisibleChange If the browser has visibly started showing the translation. @property requestedTranslationPair The language pair to translate. Usually populated after first request. 2126
TranslationError.kt The types of translation errors that can occur. Has features for determining telemetry error names and determining if an error needs to be displayed. @param errorName The translation error name. The expected use is for telemetry. @param displayError Signal to determine if we need to specifically display an error for this given issue. (Some errors should only silently report telemetry or simply revert to the prior UI state.) @param cause The original throwable before it was converted into this error state. 7745
TranslationOperation.kt The operation the translations engine is performing. 1606
TranslationOptions.kt Translation options that map to the Gecko Translations Options. @property downloadModel If the necessary models should be downloaded on request. If false, then the translation will not complete and throw an exception if the models are not already available. 609
TranslationPageSettingOperation.kt The container for referring to the different page settings. See [TranslationPageSettings] for the corresponding data model 862
TranslationPageSettings.kt Translation settings that relate to the page @property alwaysOfferPopup The setting for whether translations should automatically be offered. When true, the engine will offer to translate the page if the detected translatable page language is different from the user's preferred languages. @property alwaysTranslateLanguage The setting for whether the current page language should be automatically translated or not. When true, the page will automatically be translated by the translations engine. @property neverTranslateLanguage The setting for whether the current page language should offer a translation or not. When true, the engine will not offer a translation. @property neverTranslateSite The setting for whether the current site should be translated or not. When true, the engine will not offer a translation on the current host site. 1372
TranslationPair.kt The representation of the translation state. @property fromLanguage The language the page is translated from originally. @property toLanguage The language the page is translated to that the user knows. 580
TranslationsRuntime.kt Entry point for interacting with runtime translation options. 9701
TranslationSupport.kt The list of supported languages that may be translated to and translated from. Usually a given language will be bi-directional (translate both to and from), but this is not guaranteed, which is why the support response is two lists. @property fromLanguages The languages that the machine learning model may translate from. @property toLanguages The languages that the machine learning model may translate to. 2287