|
|
@ -22,6 +22,7 @@ import org.mozilla.fenix.compose.Divider
|
|
|
|
import org.mozilla.fenix.compose.SwitchWithLabel
|
|
|
|
import org.mozilla.fenix.compose.SwitchWithLabel
|
|
|
|
import org.mozilla.fenix.compose.annotation.LightDarkPreview
|
|
|
|
import org.mozilla.fenix.compose.annotation.LightDarkPreview
|
|
|
|
import org.mozilla.fenix.compose.list.TextListItem
|
|
|
|
import org.mozilla.fenix.compose.list.TextListItem
|
|
|
|
|
|
|
|
import org.mozilla.fenix.nimbus.FxNimbus
|
|
|
|
import org.mozilla.fenix.theme.FirefoxTheme
|
|
|
|
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 onNeverTranslationClicked Invoked when the user clicks on the "Never Translation" button.
|
|
|
|
* @param onDownloadLanguageClicked Invoked when the user clicks on the "Download Language" button.
|
|
|
|
* @param onDownloadLanguageClicked Invoked when the user clicks on the "Download Language" button.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
@Suppress("LongMethod")
|
|
|
|
@Composable
|
|
|
|
@Composable
|
|
|
|
fun TranslationSettings(
|
|
|
|
fun TranslationSettings(
|
|
|
|
translationSwitchList: List<TranslationSwitchItem>,
|
|
|
|
translationSwitchList: List<TranslationSwitchItem>,
|
|
|
@ -79,38 +81,44 @@ fun TranslationSettings(
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
item {
|
|
|
|
if (FxNimbus.features.translations.value().globalLangSettingsEnabled) {
|
|
|
|
TextListItem(
|
|
|
|
item {
|
|
|
|
label = stringResource(id = R.string.translation_settings_automatic_translation),
|
|
|
|
TextListItem(
|
|
|
|
modifier = Modifier
|
|
|
|
label = stringResource(id = R.string.translation_settings_automatic_translation),
|
|
|
|
.fillMaxWidth()
|
|
|
|
modifier = Modifier
|
|
|
|
.padding(start = 56.dp),
|
|
|
|
.fillMaxWidth()
|
|
|
|
onClick = { onAutomaticTranslationClicked() },
|
|
|
|
.padding(start = 56.dp),
|
|
|
|
)
|
|
|
|
onClick = { onAutomaticTranslationClicked() },
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
item {
|
|
|
|
if (FxNimbus.features.translations.value().globalSiteSettingsEnabled) {
|
|
|
|
TextListItem(
|
|
|
|
item {
|
|
|
|
label = stringResource(
|
|
|
|
TextListItem(
|
|
|
|
id = R.string.translation_settings_automatic_never_translate_sites,
|
|
|
|
label = stringResource(
|
|
|
|
),
|
|
|
|
id = R.string.translation_settings_automatic_never_translate_sites,
|
|
|
|
modifier = Modifier
|
|
|
|
),
|
|
|
|
.fillMaxWidth()
|
|
|
|
modifier = Modifier
|
|
|
|
.padding(start = 56.dp),
|
|
|
|
.fillMaxWidth()
|
|
|
|
onClick = { onNeverTranslationClicked() },
|
|
|
|
.padding(start = 56.dp),
|
|
|
|
)
|
|
|
|
onClick = { onNeverTranslationClicked() },
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
item {
|
|
|
|
if (FxNimbus.features.translations.value().downloadsEnabled) {
|
|
|
|
TextListItem(
|
|
|
|
item {
|
|
|
|
label = stringResource(
|
|
|
|
TextListItem(
|
|
|
|
id = R.string.translation_settings_download_language,
|
|
|
|
label = stringResource(
|
|
|
|
),
|
|
|
|
id = R.string.translation_settings_download_language,
|
|
|
|
modifier = Modifier
|
|
|
|
),
|
|
|
|
.fillMaxWidth()
|
|
|
|
modifier = Modifier
|
|
|
|
.padding(start = 56.dp),
|
|
|
|
.fillMaxWidth()
|
|
|
|
onClick = { onDownloadLanguageClicked() },
|
|
|
|
.padding(start = 56.dp),
|
|
|
|
)
|
|
|
|
onClick = { onDownloadLanguageClicked() },
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|