-
Notifications
You must be signed in to change notification settings - Fork 330
Bug 1877278 - AC Translations Check for if the Engine is Supported #5544
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -35,6 +35,7 @@ import java.util.Locale | |||||
* on application startup e.g. as an indicator that tabs have been restored. | ||||||
* @property locale The current locale of the app. Will be null when following the system default. | ||||||
* @property awesomeBarState Holds state for interactions with the [AwesomeBar]. | ||||||
* @property translationEngine Holds translation state that applies to the browser. | ||||||
*/ | ||||||
data class BrowserState( | ||||||
val tabs: List<TabSessionState> = emptyList(), | ||||||
|
@@ -54,4 +55,5 @@ data class BrowserState( | |||||
val showExtensionsProcessDisabledPrompt: Boolean = false, | ||||||
val extensionsProcessDisabled: Boolean = false, | ||||||
val awesomeBarState: AwesomeBarState = AwesomeBarState(), | ||||||
val translationEngine: TranslationsBrowserState = TranslationsBrowserState(), | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
wdyt? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ohh, should have mentioned, the name of the class that the engine reports the tab state on is Currently have:
For this one, I really struggled to find a new name:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay, I'll leave Agreed, I'll add a code health bug to refactor |
||||||
) : State |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
package mozilla.components.browser.state.state | ||
|
||
import mozilla.components.concept.engine.translate.TranslationError | ||
|
||
/** | ||
* Value type that represents the state of the translations engine within a [BrowserState]. | ||
* | ||
* @property isEngineSupported Whether the translations engine supports the device architecture. | ||
* @property engineError Holds the error state of the translations engine. | ||
* See [TranslationsState.translationError] for session level errors. | ||
*/ | ||
data class TranslationsBrowserState( | ||
val isEngineSupported: Boolean? = null, | ||
val engineError: TranslationError? = null, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had trouble deciding with the naming here, please LMK if you have ideas!