|
|
|
@ -22,6 +22,7 @@ import org.mozilla.fenix.compose.Divider
|
|
|
|
|
import org.mozilla.fenix.compose.SwitchWithLabel
|
|
|
|
|
import org.mozilla.fenix.compose.annotation.LightDarkPreview
|
|
|
|
|
import org.mozilla.fenix.compose.list.TextListItem
|
|
|
|
|
import org.mozilla.fenix.nimbus.FxNimbus
|
|
|
|
|
import org.mozilla.fenix.theme.FirefoxTheme
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -32,6 +33,7 @@ import org.mozilla.fenix.theme.FirefoxTheme
|
|
|
|
|
* @param onNeverTranslationClicked Invoked when the user clicks on the "Never Translation" button.
|
|
|
|
|
* @param onDownloadLanguageClicked Invoked when the user clicks on the "Download Language" button.
|
|
|
|
|
*/
|
|
|
|
|
@Suppress("LongMethod")
|
|
|
|
|
@Composable
|
|
|
|
|
fun TranslationSettings(
|
|
|
|
|
translationSwitchList: List<TranslationSwitchItem>,
|
|
|
|
@ -79,6 +81,7 @@ fun TranslationSettings(
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (FxNimbus.features.translations.value().globalLangSettingsEnabled) {
|
|
|
|
|
item {
|
|
|
|
|
TextListItem(
|
|
|
|
|
label = stringResource(id = R.string.translation_settings_automatic_translation),
|
|
|
|
@ -88,7 +91,9 @@ fun TranslationSettings(
|
|
|
|
|
onClick = { onAutomaticTranslationClicked() },
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (FxNimbus.features.translations.value().globalSiteSettingsEnabled) {
|
|
|
|
|
item {
|
|
|
|
|
TextListItem(
|
|
|
|
|
label = stringResource(
|
|
|
|
@ -100,7 +105,9 @@ fun TranslationSettings(
|
|
|
|
|
onClick = { onNeverTranslationClicked() },
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (FxNimbus.features.translations.value().downloadsEnabled) {
|
|
|
|
|
item {
|
|
|
|
|
TextListItem(
|
|
|
|
|
label = stringResource(
|
|
|
|
@ -115,6 +122,7 @@ fun TranslationSettings(
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Return a list of Translation option switch list item.
|
|
|
|
|