Android.Views.Translation Namespace

Provides APIs for translating view content.

Classes

Name Description
TranslationCapability

Capability class holding information for a pair of TranslationSpecs.

TranslationCapability.InterfaceConsts

Provides the parcelable interface constants inherited by TranslationCapability.

TranslationContext

Info class holding information for Translators and used by TranslationManager#createOnDeviceTranslator(TranslationContext, Executor, Consumer).

TranslationContext.Builder

A builder for TranslationContext

TranslationContext.InterfaceConsts

Provides the parcelable interface constants inherited by TranslationContext.

TranslationManager

The TranslationManager class provides ways for apps to integrate and use the translation framework.

TranslationRequest

Translation request sent to the translation service by the android.view.translation.Translator which contains the text to be translated.

TranslationRequest.Builder

A builder for TranslationRequest

TranslationRequest.InterfaceConsts

Provides the parcelable interface constants inherited by TranslationRequest.

TranslationRequestValue

A value to be translated via android.view.translation.Translator.

TranslationRequestValue.InterfaceConsts

Provides the parcelable interface constants inherited by TranslationRequestValue.

TranslationResponse

Response from the translation service, which contains the translated result.

TranslationResponse.Builder

A builder for TranslationResponse

TranslationResponse.InterfaceConsts

Provides the parcelable interface constants inherited by TranslationResponse.

TranslationResponseValue

A translated response value from translation service.

TranslationResponseValue.Builder

A builder for TranslationResponseValue

TranslationResponseValue.InterfaceConsts

Provides the parcelable interface constants inherited by TranslationResponseValue.

TranslationSpec

Specs and additional info for the translation data.

TranslationSpec.InterfaceConsts

Provides the parcelable interface constants inherited by TranslationSpec.

Translator

The Translator for translation, defined by a TranslationContext.

UiTranslationManager

The UiTranslationManager class provides ways for apps to use the ui translation function in framework.

ViewTranslationRequest

Wrapper class representing a translation request associated with a android.view.View to be used by translation service.

ViewTranslationRequest.Builder

A builder for building ViewTranslationRequest.

ViewTranslationRequest.InterfaceConsts

Provides the parcelable interface constants inherited by ViewTranslationRequest.

ViewTranslationResponse

Wrapper class representing a translation response associated with a android.view.View to be used by translation service.

ViewTranslationResponse.Builder

A builder for ViewTranslationResponse

ViewTranslationResponse.InterfaceConsts

Provides the parcelable interface constants inherited by ViewTranslationResponse.

Interfaces

Name Description
IUiTranslationStateCallback

Callback for listening to UI Translation state changes.

IViewTranslationCallback

Callback for handling the translated information show or hide in the View.

Enums

Name Description
TranslationContextFlags

Specifies optional settings for a translation context.

TranslationDataFormat

Specifies the format of translation data.

TranslationRequestFlags

Specifies the requested translation results and whether partial responses are accepted.

TranslationResponseStatus

Specifies the result status of a translation request.

TranslationResponseValueStatus

Specifies whether an individual value was translated successfully.

TranslationState

Specifies the availability of translation between a source and target specification.

Remarks

Use TranslationManager to query on-device translation capabilities and create a Translator for a source and target TranslationSpec. A TranslationContext supplies these specifications and translation settings.

TranslationRequest and TranslationResponse carry values to translate and their results. View-specific requests and responses associate these values with a view's autofill identifier. IViewTranslationCallback controls how a view shows, hides, or clears translated content.

UiTranslationManager and IUiTranslationStateCallback provide access to UI translation state changes. Their callback overloads have different Android version requirements; use the availability information on each member.