This patch supports the workflow for checking if the device architecture supports translations.
This patch adds:
* New `TranslationsBrowserState` to hold global translations engine state
* New `SetEngineSupportedAction` to set the isEngineSupported value on `TranslationsBrowserState`
* New `EngineExceptionAction` to set errors on `TranslationsBrowserState`
The goal of this bug is to have a way to update page settings.
It adds:
* A new action, `UpdatePageSettingAction`
* This action has four options:
* `UPDATE_ALWAYS_OFFER_POPUP`
* `UPDATE_ALWAYS_TRANSLATE_LANGUAGE`
* `UPDATE_NEVER_TRANSLATE_LANGUAGE`
* `UPDATE_NEVER_TRANSLATE_SITE`
* Each operation eagerly sets the new setting on the browser store, then
sends the request to the engine. If setting on the engine fails, then
they will re-request the page settings in order to remain in-sync.
This patch updates:
* `requestTranslationPageSettings` is refactored to `requestPageSettings`
to match new naming conventions
* A missing dispatch in `TranslationsMiddleware` for
fetching page settings in `requestPageSettings`
* Corrects the test that was not blocking correctly that resulted in the
missing dispatch going unnoticed.
* Resets the error to null on `SetPageSettingsAction`
This patch refactors a few things for fetching supported languages:
* `TranslateExpectedAction` is decoupled from fetching languages
* Now use `OperationRequestedAction` w/ `FETCH_SUPPORTED_LANGUAGES`
* Refactors the Fenix fragment to send `OperationRequestedAction` as a
placeholder for data initialization
* `TranslateSetLanguagesAction` is now `SetSupportedLanguagesAction`
This patch adds two new Actions:
* `OperationRequestedAction` - for requesting to fetch data
* `SetSettingsAction` - for setting that data on the browser store
`TranslationsMiddleware` reacts to these Actions by fetching and setting
the appropriate data.
The patch to update data will be bug 1877203.
This patch corrects an issue where `isTranslateProcessing` and
`isRestoreProcessing` states were not updating due to not sending along
pre-process actions in `EngineDelegateMiddleware`.
This patch adds the additional state information of `supportedLanguages` and `translationError` to `TranslationsState`. The `supportedLanguages` are the languages the translation engine supports for translating for use in UI dropdowns. `translationError` is any error that occurred relating to translating.
`supportedLanguages` is currently set via an action that indicates the intention to translate on the new `EngineMiddleware` addition of `TranslationsMiddleware`. This patch also adds a new `TranslationOperation` of `FETCH_TO_AND_FROM_LANGUAGES` to indicate the process of getting `supportedLanguages`.
`translationError` is added to the `TranslationsState` to store errors as they arise. `TranslateExceptionAction` is also refactored from using the generic `Throwable` to the new `TranslationError` to accommodate `supportedLanguages` and better general error handling.O_AND_FROM_LANGUAGES` to indicate the process of getting `supportedLanguages`.
This bug adds a few options for translations preferences on the engine,
including:
* (Runtime Setting) Option to get/set translations offer popup
* (Runtime Request) Option to get/set translation language preference
* (Session Request) Option to get/set a site's translation preference
This bug adds a translation session delegate for receiving information
from GeckoView on the state of the toolkit translation engine and also
when to expect and offer translations on a given page.
It also updates reference browser to use auto-detected defaults for
translating.
This patch adds engine support for translate and restoring the page after
a translation. `requestTranslate` and `requestTranslationRestore` are
the Gecko engine session functions.
This corresponding actions for these functions are `TranslateAction`,
and `TranslateRestoreAction`. The success and failure correspond to the
actions `TranslateSuccessAction` and `TranslateExceptionAction`.
Sample usage is provided on reference browser. The sample is currently
hardcoded to support Spanish to English page translations until the next
API is introduced.
This commit adds:
* An `AwesomeBarState` class to hold the currently visible suggestions
and last clicked suggestion.
* `VisibilityStateUpdated` and `SuggestionClicked` `AwesomeBarAction`s
to update the state, and an `EngagementFinished` action to reset the
state. Consumers will dispatch these actions on the `BrowserStore`
in response to user interactions with the awesomebar and toolbar.
* A `metadata` map to `AwesomeBar.Suggestion`, allowing providers to
attach opaque data to each suggestion.