Skip to content

Commit e127845

Browse files
committed
feat: Rename strings
1 parent d4d2056 commit e127845

17 files changed

+89
-100
lines changed

app/src/main/java/app/revanced/manager/domain/bundles/PatchBundleSource.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ sealed class PatchBundleSource(initialName: String, val uid: Int, directory: Fil
3434

3535
private val _nameFlow = MutableStateFlow(initialName)
3636
val nameFlow =
37-
_nameFlow.map { it.ifEmpty { app.getString(if (isDefault) R.string.bundle_name_default else R.string.bundle_name_fallback) } }
37+
_nameFlow.map { it.ifEmpty { app.getString(if (isDefault) R.string.patches_name_default else R.string.patches_name_fallback) } }
3838

3939
suspend fun getName() = nameFlow.first()
4040

app/src/main/java/app/revanced/manager/domain/bundles/RemotePatchBundle.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ sealed class RemotePatchBundle(name: String, id: Int, directory: File, val endpo
5050
suspend fun setAutoUpdate(value: Boolean) = configRepository.setAutoUpdate(uid, value)
5151

5252
companion object {
53-
const val updateFailMsg = "Failed to update patch bundle(s)"
53+
const val updateFailMsg = "Failed to update patches"
5454
}
5555
}
5656

app/src/main/java/app/revanced/manager/domain/repository/PatchBundleRepository.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ class PatchBundleRepository(
165165
getBundlesByType<RemotePatchBundle>().forEach { it.downloadLatest() }
166166

167167
suspend fun updateCheck() =
168-
uiSafe(app, R.string.source_download_fail, "Failed to update bundles") {
168+
uiSafe(app, R.string.patches_download_fail, "Failed to update bundles") {
169169
coroutineScope {
170170
if (!networkInfo.isSafe()) {
171171
Log.d(tag, "Skipping update check because the network is down or metered.")

app/src/main/java/app/revanced/manager/ui/component/ExceptionViewerDialog.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ fun ExceptionViewerDialog(text: String, onDismiss: () -> Unit) {
3030
Scaffold(
3131
topBar = {
3232
BundleTopBar(
33-
title = stringResource(R.string.bundle_error),
33+
title = stringResource(R.string.patches_error),
3434
onBackClick = onDismiss,
3535
backIcon = {
3636
Icon(

app/src/main/java/app/revanced/manager/ui/component/bundle/BaseBundleDialog.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ fun BaseBundleDialog(
9292

9393
if (remoteUrl != null) {
9494
BundleListItem(
95-
headlineText = stringResource(R.string.bundle_auto_update),
96-
supportingText = stringResource(R.string.bundle_auto_update_description),
95+
headlineText = stringResource(R.string.auto_update),
96+
supportingText = stringResource(R.string.auto_update_description),
9797
trailingContent = {
9898
HapticSwitch(
9999
checked = autoUpdate,
@@ -113,7 +113,7 @@ fun BaseBundleDialog(
113113
if (showUrlInputDialog) {
114114
TextInputDialog(
115115
initial = url,
116-
title = stringResource(R.string.bundle_input_source_url),
116+
title = stringResource(R.string.patches_url),
117117
onDismissRequest = { showUrlInputDialog = false },
118118
onConfirm = {
119119
showUrlInputDialog = false
@@ -134,7 +134,7 @@ fun BaseBundleDialog(
134134
showUrlInputDialog = true
135135
}
136136
),
137-
headlineText = stringResource(R.string.bundle_input_source_url),
137+
headlineText = stringResource(R.string.patches_url),
138138
supportingText = url.ifEmpty {
139139
stringResource(R.string.field_not_set)
140140
}
@@ -143,8 +143,8 @@ fun BaseBundleDialog(
143143

144144
val patchesClickable = patchCount > 0
145145
BundleListItem(
146-
headlineText = stringResource(R.string.bundle_view_patches),
147-
supportingText = stringResource(R.string.bundle_view_all_patches, patchCount),
146+
headlineText = stringResource(R.string.patches),
147+
supportingText = stringResource(R.string.view_patches),
148148
modifier = Modifier.clickable(
149149
enabled = patchesClickable,
150150
onClick = onPatchesClick

app/src/main/java/app/revanced/manager/ui/component/bundle/BundleInformationDialog.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ fun BundleInformationDialog(
119119
)
120120

121121
BundleListItem(
122-
headlineText = stringResource(R.string.bundle_error),
123-
supportingText = stringResource(R.string.bundle_error_description),
122+
headlineText = stringResource(R.string.patches_error),
123+
supportingText = stringResource(R.string.patches_error_description),
124124
trailingContent = {
125125
Icon(
126126
Icons.AutoMirrored.Outlined.ArrowRight,
@@ -133,8 +133,8 @@ fun BundleInformationDialog(
133133

134134
if (state is PatchBundleSource.State.Missing && !isLocal) {
135135
BundleListItem(
136-
headlineText = stringResource(R.string.bundle_error),
137-
supportingText = stringResource(R.string.bundle_not_downloaded),
136+
headlineText = stringResource(R.string.patches_error),
137+
supportingText = stringResource(R.string.patches_not_downloaded),
138138
modifier = Modifier.clickable(onClick = onUpdate)
139139
)
140140
}

app/src/main/java/app/revanced/manager/ui/component/bundle/BundleItem.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ fun BundleItem(
6767
onDelete()
6868
viewBundleDialogPage = false
6969
},
70-
title = stringResource(R.string.bundle_delete_single_dialog_title),
71-
description = stringResource(R.string.bundle_delete_single_dialog_description, name),
70+
title = stringResource(R.string.delete),
71+
description = stringResource(R.string.patches_delete_single_dialog_description, name),
7272
icon = Icons.Outlined.Delete
7373
)
7474
}
@@ -100,8 +100,8 @@ fun BundleItem(
100100
Row {
101101
val icon = remember(state) {
102102
when (state) {
103-
is PatchBundleSource.State.Failed -> Icons.Outlined.ErrorOutline to R.string.bundle_error
104-
is PatchBundleSource.State.Missing -> Icons.Outlined.Warning to R.string.bundle_missing
103+
is PatchBundleSource.State.Failed -> Icons.Outlined.ErrorOutline to R.string.patches_error
104+
is PatchBundleSource.State.Missing -> Icons.Outlined.Warning to R.string.patches_missing
105105
is PatchBundleSource.State.Loaded -> null
106106
}
107107
}

app/src/main/java/app/revanced/manager/ui/component/bundle/BundlePatchesDialog.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ fun BundlePatchesDialog(
4646
Scaffold(
4747
topBar = {
4848
BundleTopBar(
49-
title = stringResource(R.string.bundle_patches),
49+
title = stringResource(R.string.patches),
5050
onBackClick = onDismissRequest,
5151
backIcon = {
5252
Icon(
@@ -133,10 +133,10 @@ fun PatchItem(
133133
verticalAlignment = Alignment.CenterVertically
134134
) {
135135
PatchInfoChip(
136-
text = "$PACKAGE_ICON ${stringResource(R.string.bundle_view_patches_any_package)}"
136+
text = "$PACKAGE_ICON ${stringResource(R.string.patches_view_any_package)}"
137137
)
138138
PatchInfoChip(
139-
text = "$VERSION_ICON ${stringResource(R.string.bundle_view_patches_any_version)}"
139+
text = "$VERSION_ICON ${stringResource(R.string.patches_view_any_version)}"
140140
)
141141
}
142142
} else {

app/src/main/java/app/revanced/manager/ui/component/bundle/BundleSelector.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ import androidx.compose.material3.Text
1313
import androidx.compose.runtime.Composable
1414
import androidx.compose.runtime.LaunchedEffect
1515
import androidx.compose.runtime.getValue
16-
import androidx.compose.runtime.remember
1716
import androidx.compose.ui.Alignment
1817
import androidx.compose.ui.Modifier
18+
import androidx.compose.ui.res.stringResource
1919
import androidx.compose.ui.unit.dp
2020
import androidx.lifecycle.compose.collectAsStateWithLifecycle
21+
import app.revanced.manager.R
2122
import app.revanced.manager.domain.bundles.PatchBundleSource
2223
import app.revanced.manager.domain.bundles.PatchBundleSource.Extensions.nameState
23-
import kotlinx.coroutines.flow.map
2424

2525
@OptIn(ExperimentalMaterial3Api::class)
2626
@Composable
@@ -50,7 +50,7 @@ fun BundleSelector(bundles: List<PatchBundleSource>, onFinish: (PatchBundleSourc
5050
.fillMaxWidth()
5151
) {
5252
Text(
53-
text = "Select bundle",
53+
text = stringResource(R.string.select),
5454
style = MaterialTheme.typography.titleLarge,
5555
color = MaterialTheme.colorScheme.onSurface
5656
)

app/src/main/java/app/revanced/manager/ui/component/bundle/ImportBundleDialog.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ fun ImportPatchBundleDialog(
7777
AlertDialogExtended(
7878
onDismissRequest = onDismiss,
7979
title = {
80-
Text(stringResource(if (currentStep == 0) R.string.select else R.string.add_patch_bundle))
80+
Text(stringResource(if (currentStep == 0) R.string.select else R.string.add_patches))
8181
},
8282
text = {
8383
steps[currentStep]()
@@ -126,7 +126,7 @@ fun SelectBundleTypeStep(
126126
) {
127127
Text(
128128
modifier = Modifier.padding(horizontal = 24.dp),
129-
text = stringResource(R.string.select_bundle_type_dialog_description)
129+
text = stringResource(R.string.select_patches_type_dialog_description)
130130
)
131131
Column {
132132
ListItem(
@@ -136,7 +136,7 @@ fun SelectBundleTypeStep(
136136
),
137137
headlineContent = { Text(stringResource(R.string.enter_url)) },
138138
overlineContent = { Text(stringResource(R.string.recommended)) },
139-
supportingContent = { Text(stringResource(R.string.remote_bundle_description)) },
139+
supportingContent = { Text(stringResource(R.string.remote_patches_description)) },
140140
leadingContent = {
141141
HapticRadioButton(
142142
selected = bundleType == BundleType.Remote,
@@ -152,7 +152,7 @@ fun SelectBundleTypeStep(
152152
onClick = { onBundleTypeSelected(BundleType.Local) }
153153
),
154154
headlineContent = { Text(stringResource(R.string.select_from_storage)) },
155-
supportingContent = { Text(stringResource(R.string.local_bundle_description)) },
155+
supportingContent = { Text(stringResource(R.string.local_patches_description)) },
156156
overlineContent = { },
157157
leadingContent = {
158158
HapticRadioButton(
@@ -185,7 +185,7 @@ fun ImportBundleStep(
185185
) {
186186
ListItem(
187187
headlineContent = {
188-
Text(stringResource(R.string.patch_bundle_field))
188+
Text(stringResource(R.string.patches))
189189
},
190190
supportingContent = { Text(stringResource(if (patchBundle != null) R.string.file_field_set else R.string.file_field_not_set)) },
191191
trailingContent = {
@@ -206,7 +206,7 @@ fun ImportBundleStep(
206206
OutlinedTextField(
207207
value = remoteUrl,
208208
onValueChange = onRemoteUrlChange,
209-
label = { Text(stringResource(R.string.bundle_url)) }
209+
label = { Text(stringResource(R.string.patches_url)) }
210210
)
211211
}
212212
Column(

0 commit comments

Comments
 (0)