Create dedicated modules for Strings and apply the plugin com.likethesalad.stem
Remove translations
This commit is contained in:
parent
da59e812a7
commit
8c93aedbc1
33 changed files with 384 additions and 182 deletions
|
|
@ -56,7 +56,7 @@ import io.element.android.x.core.compose.textFieldState
|
|||
import io.element.android.x.designsystem.ElementXTheme
|
||||
import io.element.android.x.designsystem.components.LabelledCheckbox
|
||||
import io.element.android.x.designsystem.components.dialogs.ErrorDialog
|
||||
import io.element.android.x.element.resources.R as ElementR
|
||||
import io.element.android.x.ui.strings.R as StringR
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
|
|
@ -96,7 +96,7 @@ fun BugReportView(
|
|||
val isFormEnabled = state.sending !is Async.Loading
|
||||
// Title
|
||||
Text(
|
||||
text = stringResource(id = ElementR.string.send_bug_report),
|
||||
text = stringResource(id = StringR.string.send_bug_report),
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(horizontal = 16.dp, vertical = 16.dp),
|
||||
|
|
@ -106,7 +106,7 @@ fun BugReportView(
|
|||
)
|
||||
// Form
|
||||
Text(
|
||||
text = stringResource(id = ElementR.string.send_bug_report_description),
|
||||
text = stringResource(id = StringR.string.send_bug_report_description),
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(horizontal = 16.dp, vertical = 16.dp),
|
||||
|
|
@ -123,10 +123,10 @@ fun BugReportView(
|
|||
.padding(top = 16.dp),
|
||||
enabled = isFormEnabled,
|
||||
label = {
|
||||
Text(text = stringResource(id = ElementR.string.send_bug_report_placeholder))
|
||||
Text(text = stringResource(id = StringR.string.send_bug_report_placeholder))
|
||||
},
|
||||
supportingText = {
|
||||
Text(text = stringResource(id = ElementR.string.send_bug_report_description_in_english))
|
||||
Text(text = stringResource(id = StringR.string.send_bug_report_description_in_english))
|
||||
},
|
||||
onValueChange = {
|
||||
descriptionFieldState = it
|
||||
|
|
@ -143,28 +143,28 @@ fun BugReportView(
|
|||
checked = state.formState.sendLogs,
|
||||
onCheckedChange = { eventSink(BugReportEvents.SetSendLog(it)) },
|
||||
enabled = isFormEnabled,
|
||||
text = stringResource(id = ElementR.string.send_bug_report_include_logs)
|
||||
text = stringResource(id = StringR.string.send_bug_report_include_logs)
|
||||
)
|
||||
if (state.hasCrashLogs) {
|
||||
LabelledCheckbox(
|
||||
checked = state.formState.sendCrashLogs,
|
||||
onCheckedChange = { eventSink(BugReportEvents.SetSendCrashLog(it)) },
|
||||
enabled = isFormEnabled,
|
||||
text = stringResource(id = ElementR.string.send_bug_report_include_crash_logs)
|
||||
text = stringResource(id = StringR.string.send_bug_report_include_crash_logs)
|
||||
)
|
||||
}
|
||||
LabelledCheckbox(
|
||||
checked = state.formState.canContact,
|
||||
onCheckedChange = { eventSink(BugReportEvents.SetCanContact(it)) },
|
||||
enabled = isFormEnabled,
|
||||
text = stringResource(id = ElementR.string.you_may_contact_me)
|
||||
text = stringResource(id = StringR.string.you_may_contact_me)
|
||||
)
|
||||
if (state.screenshotUri != null) {
|
||||
LabelledCheckbox(
|
||||
checked = state.formState.sendScreenshot,
|
||||
onCheckedChange = { eventSink(BugReportEvents.SetSendScreenshot(it)) },
|
||||
enabled = isFormEnabled,
|
||||
text = stringResource(id = ElementR.string.send_bug_report_include_screenshot)
|
||||
text = stringResource(id = StringR.string.send_bug_report_include_screenshot)
|
||||
)
|
||||
if (state.formState.sendScreenshot) {
|
||||
Box(
|
||||
|
|
@ -191,7 +191,7 @@ fun BugReportView(
|
|||
.fillMaxWidth()
|
||||
.padding(vertical = 32.dp)
|
||||
) {
|
||||
Text(text = stringResource(id = ElementR.string.action_send))
|
||||
Text(text = stringResource(id = StringR.string.action_send))
|
||||
}
|
||||
}
|
||||
when (state.sending) {
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ import androidx.compose.ui.tooling.preview.Preview
|
|||
import io.element.android.x.core.compose.LogCompositions
|
||||
import io.element.android.x.designsystem.ElementXTheme
|
||||
import io.element.android.x.designsystem.components.dialogs.ConfirmationDialog
|
||||
import io.element.android.x.element.resources.R as ElementR
|
||||
import io.element.android.x.ui.strings.R as StringR
|
||||
|
||||
@Composable
|
||||
fun CrashDetectionView(
|
||||
|
|
@ -53,10 +53,10 @@ fun CrashDetectionContent(
|
|||
onDismiss: () -> Unit = { },
|
||||
) {
|
||||
ConfirmationDialog(
|
||||
title = stringResource(id = ElementR.string.send_bug_report),
|
||||
content = stringResource(id = ElementR.string.send_bug_report_app_crashed),
|
||||
submitText = stringResource(id = ElementR.string.yes),
|
||||
cancelText = stringResource(id = ElementR.string.no),
|
||||
title = stringResource(id = StringR.string.send_bug_report),
|
||||
content = stringResource(id = StringR.string.send_bug_report_app_crashed),
|
||||
submitText = stringResource(id = StringR.string.yes),
|
||||
cancelText = stringResource(id = StringR.string.no),
|
||||
onCancelClicked = onNoClicked,
|
||||
onSubmitClicked = onYesClicked,
|
||||
onDismiss = onDismiss,
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ import io.element.android.x.core.screenshot.ImageResult
|
|||
import io.element.android.x.core.screenshot.screenshot
|
||||
import io.element.android.x.designsystem.ElementXTheme
|
||||
import io.element.android.x.designsystem.components.dialogs.ConfirmationDialog
|
||||
import io.element.android.x.element.resources.R as ElementR
|
||||
import io.element.android.x.ui.strings.R as StringR
|
||||
|
||||
@Composable
|
||||
fun RageshakeDetectionView(
|
||||
|
|
@ -83,11 +83,11 @@ fun RageshakeDialogContent(
|
|||
onYesClicked: () -> Unit = { },
|
||||
) {
|
||||
ConfirmationDialog(
|
||||
title = stringResource(id = ElementR.string.send_bug_report),
|
||||
content = stringResource(id = ElementR.string.send_bug_report_alert_message),
|
||||
thirdButtonText = stringResource(id = ElementR.string.action_disable),
|
||||
submitText = stringResource(id = ElementR.string.yes),
|
||||
cancelText = stringResource(id = ElementR.string.no),
|
||||
title = stringResource(id = StringR.string.send_bug_report),
|
||||
content = stringResource(id = StringR.string.send_bug_report_alert_message),
|
||||
thirdButtonText = stringResource(id = StringR.string.action_disable),
|
||||
submitText = stringResource(id = StringR.string.yes),
|
||||
cancelText = stringResource(id = StringR.string.no),
|
||||
onCancelClicked = onNoClicked,
|
||||
onThirdButtonClicked = onDisableClicked,
|
||||
onSubmitClicked = onYesClicked,
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ import io.element.android.x.designsystem.components.preferences.PreferenceCatego
|
|||
import io.element.android.x.designsystem.components.preferences.PreferenceSlide
|
||||
import io.element.android.x.designsystem.components.preferences.PreferenceSwitch
|
||||
import io.element.android.x.designsystem.components.preferences.PreferenceText
|
||||
import io.element.android.x.element.resources.R as ElementR
|
||||
import io.element.android.x.ui.strings.R as StringR
|
||||
|
||||
@Composable
|
||||
fun RageshakePreferencesView(
|
||||
|
|
@ -44,24 +44,23 @@ fun RageshakePreferencesView(
|
|||
}
|
||||
|
||||
Column(modifier = modifier) {
|
||||
PreferenceCategory(title = stringResource(id = ElementR.string.send_bug_report)) {
|
||||
PreferenceCategory(title = stringResource(id = StringR.string.send_bug_report)) {
|
||||
PreferenceText(
|
||||
title = stringResource(id = ElementR.string.send_bug_report),
|
||||
title = stringResource(id = StringR.string.send_bug_report),
|
||||
icon = Icons.Default.BugReport,
|
||||
onClick = onOpenRageshake
|
||||
)
|
||||
}
|
||||
|
||||
PreferenceCategory(title = stringResource(id = ElementR.string.settings_rageshake)) {
|
||||
PreferenceCategory(title = stringResource(id = StringR.string.settings_rageshake)) {
|
||||
if (state.isSupported) {
|
||||
PreferenceSwitch(
|
||||
title = stringResource(id = ElementR.string.send_bug_report_rage_shake),
|
||||
title = stringResource(id = StringR.string.send_bug_report_rage_shake),
|
||||
isChecked = state.isEnabled,
|
||||
onCheckedChange = ::onEnabledChanged
|
||||
)
|
||||
PreferenceSlide(
|
||||
title = stringResource(id = ElementR.string.settings_rageshake_detection_threshold),
|
||||
// summary = stringResource(id = ElementR.string.settings_rageshake_detection_threshold_summary),
|
||||
title = stringResource(id = StringR.string.settings_rageshake_detection_threshold),
|
||||
// summary = stringResource(id = StringR.string.settings_rageshake_detection_threshold_summary),
|
||||
value = state.sensitivity,
|
||||
enabled = state.isEnabled,
|
||||
steps = 3 /* 5 possible values - steps are in ]0, 1[ */,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue