[Strings] Use strings from localazy.
This commit is contained in:
parent
d449ede86d
commit
c774f7529e
33 changed files with 216 additions and 182 deletions
|
|
@ -19,6 +19,7 @@ package io.element.android.features.rageshake.api.crash
|
|||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import io.element.android.features.rageshake.api.R
|
||||
import io.element.android.libraries.designsystem.components.dialogs.ConfirmationDialog
|
||||
import io.element.android.libraries.designsystem.preview.ElementPreviewDark
|
||||
import io.element.android.libraries.designsystem.preview.ElementPreviewLight
|
||||
|
|
@ -55,10 +56,10 @@ fun CrashDetectionContent(
|
|||
onDismiss: () -> Unit = { },
|
||||
) {
|
||||
ConfirmationDialog(
|
||||
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),
|
||||
title = stringResource(id = StringR.string.action_report_bug),
|
||||
content = stringResource(id = R.string.crash_detection_dialog_content, /* TODO App name */ "Element"),
|
||||
submitText = stringResource(id = StringR.string.action_yes),
|
||||
cancelText = stringResource(id = StringR.string.action_no),
|
||||
onCancelClicked = onNoClicked,
|
||||
onSubmitClicked = onYesClicked,
|
||||
onDismiss = onDismiss,
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ import androidx.compose.ui.platform.LocalView
|
|||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.lifecycle.Lifecycle
|
||||
import io.element.android.features.rageshake.api.R
|
||||
import io.element.android.features.rageshake.api.screenshot.ImageResult
|
||||
import io.element.android.features.rageshake.api.screenshot.screenshot
|
||||
import io.element.android.libraries.androidutils.hardware.vibrate
|
||||
|
|
@ -87,11 +88,11 @@ fun RageshakeDialogContent(
|
|||
onYesClicked: () -> Unit = { },
|
||||
) {
|
||||
ConfirmationDialog(
|
||||
title = stringResource(id = StringR.string.send_bug_report),
|
||||
content = stringResource(id = StringR.string.send_bug_report_alert_message),
|
||||
title = stringResource(id = StringR.string.action_report_bug),
|
||||
content = stringResource(id = R.string.rageshake_detection_dialog_content),
|
||||
thirdButtonText = stringResource(id = StringR.string.action_disable),
|
||||
submitText = stringResource(id = StringR.string.yes),
|
||||
cancelText = stringResource(id = StringR.string.no),
|
||||
submitText = stringResource(id = StringR.string.action_yes),
|
||||
cancelText = stringResource(id = StringR.string.action_no),
|
||||
onCancelClicked = onNoClicked,
|
||||
onThirdButtonClicked = onDisableClicked,
|
||||
onSubmitClicked = onYesClicked,
|
||||
|
|
|
|||
|
|
@ -47,9 +47,9 @@ fun RageshakePreferencesView(
|
|||
}
|
||||
|
||||
Column(modifier = modifier) {
|
||||
PreferenceCategory(title = stringResource(id = StringR.string.send_bug_report)) {
|
||||
PreferenceCategory(title = stringResource(id = StringR.string.action_report_bug)) {
|
||||
PreferenceText(
|
||||
title = stringResource(id = StringR.string.send_bug_report),
|
||||
title = stringResource(id = StringR.string.action_report_bug),
|
||||
icon = Icons.Default.BugReport,
|
||||
onClick = onOpenRageshake
|
||||
)
|
||||
|
|
@ -57,7 +57,7 @@ fun RageshakePreferencesView(
|
|||
PreferenceCategory(title = stringResource(id = StringR.string.settings_rageshake)) {
|
||||
if (state.isSupported) {
|
||||
PreferenceSwitch(
|
||||
title = stringResource(id = StringR.string.send_bug_report_rage_shake),
|
||||
title = stringResource(id = StringR.string.preference_rageshake),
|
||||
isChecked = state.isEnabled,
|
||||
onCheckedChange = ::onEnabledChanged
|
||||
)
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ import androidx.compose.ui.unit.dp
|
|||
import androidx.compose.ui.unit.sp
|
||||
import coil.compose.AsyncImage
|
||||
import coil.request.ImageRequest
|
||||
import io.element.android.features.rageshake.impl.R
|
||||
import io.element.android.libraries.architecture.Async
|
||||
import io.element.android.libraries.designsystem.components.LabelledCheckbox
|
||||
import io.element.android.libraries.designsystem.components.dialogs.ErrorDialog
|
||||
|
|
@ -92,7 +93,7 @@ fun BugReportView(
|
|||
val isFormEnabled = state.sending !is Async.Loading
|
||||
// Title
|
||||
Text(
|
||||
text = stringResource(id = StringR.string.send_bug_report),
|
||||
text = stringResource(id = StringR.string.action_report_bug),
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(horizontal = 16.dp, vertical = 16.dp),
|
||||
|
|
@ -103,7 +104,7 @@ fun BugReportView(
|
|||
)
|
||||
// Form
|
||||
Text(
|
||||
text = stringResource(id = StringR.string.send_bug_report_description),
|
||||
text = stringResource(id = R.string.screen_bug_report_editor_description),
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(horizontal = 16.dp, vertical = 16.dp),
|
||||
|
|
@ -123,10 +124,10 @@ fun BugReportView(
|
|||
.padding(top = 16.dp),
|
||||
enabled = isFormEnabled,
|
||||
label = {
|
||||
Text(text = stringResource(id = StringR.string.send_bug_report_placeholder))
|
||||
Text(text = stringResource(id = R.string.screen_bug_report_editor_placeholder))
|
||||
},
|
||||
supportingText = {
|
||||
Text(text = stringResource(id = StringR.string.send_bug_report_description_in_english))
|
||||
Text(text = stringResource(id = R.string.screen_bug_report_editor_supporting))
|
||||
},
|
||||
onValueChange = {
|
||||
descriptionFieldState = it
|
||||
|
|
@ -143,28 +144,28 @@ fun BugReportView(
|
|||
checked = state.formState.sendLogs,
|
||||
onCheckedChange = { eventSink(BugReportEvents.SetSendLog(it)) },
|
||||
enabled = isFormEnabled,
|
||||
text = stringResource(id = StringR.string.send_bug_report_include_logs)
|
||||
text = stringResource(id = R.string.screen_bug_report_include_logs)
|
||||
)
|
||||
if (state.hasCrashLogs) {
|
||||
LabelledCheckbox(
|
||||
checked = state.formState.sendCrashLogs,
|
||||
onCheckedChange = { eventSink(BugReportEvents.SetSendCrashLog(it)) },
|
||||
enabled = isFormEnabled,
|
||||
text = stringResource(id = StringR.string.send_bug_report_include_crash_logs)
|
||||
text = stringResource(id = R.string.screen_bug_report_include_crash_logs)
|
||||
)
|
||||
}
|
||||
LabelledCheckbox(
|
||||
checked = state.formState.canContact,
|
||||
onCheckedChange = { eventSink(BugReportEvents.SetCanContact(it)) },
|
||||
enabled = isFormEnabled,
|
||||
text = stringResource(id = StringR.string.you_may_contact_me)
|
||||
text = stringResource(id = R.string.screen_bug_report_contact_me)
|
||||
)
|
||||
if (state.screenshotUri != null) {
|
||||
LabelledCheckbox(
|
||||
checked = state.formState.sendScreenshot,
|
||||
onCheckedChange = { eventSink(BugReportEvents.SetSendScreenshot(it)) },
|
||||
enabled = isFormEnabled,
|
||||
text = stringResource(id = StringR.string.send_bug_report_include_screenshot)
|
||||
text = stringResource(id = R.string.screen_bug_report_include_screenshot)
|
||||
)
|
||||
if (state.formState.sendScreenshot) {
|
||||
Box(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue