feat: Rename strings

This commit is contained in:
oSumAtrIX
2025-05-10 20:37:26 +02:00
parent 71a2a73140
commit da47dff81a
15 changed files with 72 additions and 76 deletions

View File

@ -34,7 +34,7 @@ sealed class PatchBundleSource(initialName: String, val uid: Int, directory: Fil
private val _nameFlow = MutableStateFlow(initialName)
val nameFlow =
_nameFlow.map { it.ifEmpty { app.getString(if (isDefault) R.string.bundle_name_default else R.string.bundle_name_fallback) } }
_nameFlow.map { it.ifEmpty { app.getString(if (isDefault) R.string.patches_name_default else R.string.patches_name_fallback) } }
suspend fun getName() = nameFlow.first()

View File

@ -165,7 +165,7 @@ class PatchBundleRepository(
getBundlesByType<RemotePatchBundle>().forEach { it.downloadLatest() }
suspend fun updateCheck() =
uiSafe(app, R.string.source_download_fail, "Failed to update bundles") {
uiSafe(app, R.string.patches_download_fail, "Failed to update bundles") {
coroutineScope {
if (!networkInfo.isSafe()) {
Log.d(tag, "Skipping update check because the network is down or metered.")

View File

@ -36,7 +36,7 @@ fun ExceptionViewerDialog(text: String, onDismiss: () -> Unit) {
Scaffold(
topBar = {
BundleTopBar(
title = stringResource(R.string.bundle_error),
title = stringResource(R.string.patches_error),
onBackClick = onDismiss,
backIcon = {
Icon(

View File

@ -87,8 +87,8 @@ fun BaseBundleDialog(
if (remoteUrl != null) {
BundleListItem(
headlineText = stringResource(R.string.bundle_auto_update),
supportingText = stringResource(R.string.bundle_auto_update_description),
headlineText = stringResource(R.string.auto_update),
supportingText = stringResource(R.string.auto_update_description),
trailingContent = {
HapticSwitch(
checked = autoUpdate,
@ -108,7 +108,7 @@ fun BaseBundleDialog(
if (showUrlInputDialog) {
TextInputDialog(
initial = url,
title = stringResource(R.string.bundle_input_source_url),
title = stringResource(R.string.patches_url),
onDismissRequest = { showUrlInputDialog = false },
onConfirm = {
showUrlInputDialog = false
@ -129,7 +129,7 @@ fun BaseBundleDialog(
showUrlInputDialog = true
}
),
headlineText = stringResource(R.string.bundle_input_source_url),
headlineText = stringResource(R.string.patches_url),
supportingText = url.ifEmpty {
stringResource(R.string.field_not_set)
}
@ -139,7 +139,7 @@ fun BaseBundleDialog(
val patchesClickable = patchCount > 0
BundleListItem(
headlineText = stringResource(R.string.patches),
supportingText = stringResource(R.string.bundle_view_patches),
supportingText = stringResource(R.string.patches_view),
modifier = Modifier.clickable(
enabled = patchesClickable,
onClick = onPatchesClick

View File

@ -68,7 +68,7 @@ fun BundleInformationDialog(
Scaffold(
topBar = {
BundleTopBar(
title = stringResource(R.string.patch_bundle_field),
title = stringResource(R.string.patches),
onBackClick = onDismissRequest,
backIcon = {
Icon(
@ -124,8 +124,8 @@ fun BundleInformationDialog(
)
BundleListItem(
headlineText = stringResource(R.string.bundle_error),
supportingText = stringResource(R.string.bundle_error_description),
headlineText = stringResource(R.string.patches_error),
supportingText = stringResource(R.string.patches_error_description),
trailingContent = {
Icon(
Icons.AutoMirrored.Outlined.ArrowRight,
@ -138,8 +138,8 @@ fun BundleInformationDialog(
if (state is PatchBundleSource.State.Missing && !isLocal) {
BundleListItem(
headlineText = stringResource(R.string.bundle_error),
supportingText = stringResource(R.string.bundle_not_downloaded),
headlineText = stringResource(R.string.patches_error),
supportingText = stringResource(R.string.patches_not_downloaded),
modifier = Modifier.clickable(onClick = onUpdate)
)
}

View File

@ -88,8 +88,8 @@ fun BundleItem(
Row {
val icon = remember(state) {
when (state) {
is PatchBundleSource.State.Failed -> Icons.Outlined.ErrorOutline to R.string.bundle_error
is PatchBundleSource.State.Missing -> Icons.Outlined.Warning to R.string.bundle_missing
is PatchBundleSource.State.Failed -> Icons.Outlined.ErrorOutline to R.string.patches_error
is PatchBundleSource.State.Missing -> Icons.Outlined.Warning to R.string.patches_missing
is PatchBundleSource.State.Loaded -> null
}
}

View File

@ -51,7 +51,7 @@ fun BundlePatchesDialog(
Scaffold(
topBar = {
BundleTopBar(
title = stringResource(R.string.bundle_patches),
title = stringResource(R.string.patches),
onBackClick = onDismissRequest,
backIcon = {
Icon(
@ -138,10 +138,10 @@ fun PatchItem(
verticalAlignment = Alignment.CenterVertically
) {
PatchInfoChip(
text = "$PACKAGE_ICON ${stringResource(R.string.bundle_view_patches_any_package)}"
text = "$PACKAGE_ICON ${stringResource(R.string.patches_view_any_package)}"
)
PatchInfoChip(
text = "$VERSION_ICON ${stringResource(R.string.bundle_view_patches_any_version)}"
text = "$VERSION_ICON ${stringResource(R.string.patches_view_any_version)}"
)
}
} else {

View File

@ -15,7 +15,9 @@ import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import app.revanced.manager.R
import app.revanced.manager.domain.bundles.PatchBundleSource
import app.revanced.manager.domain.bundles.PatchBundleSource.Extensions.nameState
@ -47,7 +49,7 @@ fun BundleSelector(bundles: List<PatchBundleSource>, onFinish: (PatchBundleSourc
.fillMaxWidth()
) {
Text(
text = "Select bundle",
text = stringResource(R.string.select),
style = MaterialTheme.typography.titleLarge,
color = MaterialTheme.colorScheme.onSurface
)

View File

@ -77,7 +77,7 @@ fun ImportPatchBundleDialog(
AlertDialogExtended(
onDismissRequest = onDismiss,
title = {
Text(stringResource(if (currentStep == 0) R.string.select else R.string.add_patch_bundle))
Text(stringResource(if (currentStep == 0) R.string.select else R.string.add_patches))
},
text = {
steps[currentStep]()
@ -126,7 +126,7 @@ fun SelectBundleTypeStep(
) {
Text(
modifier = Modifier.padding(horizontal = 24.dp),
text = stringResource(R.string.select_bundle_type_dialog_description)
text = stringResource(R.string.select_patches_type_dialog_description)
)
Column {
ListItem(
@ -136,7 +136,7 @@ fun SelectBundleTypeStep(
),
headlineContent = { Text(stringResource(R.string.enter_url)) },
overlineContent = { Text(stringResource(R.string.recommended)) },
supportingContent = { Text(stringResource(R.string.remote_bundle_description)) },
supportingContent = { Text(stringResource(R.string.remote_patches_description)) },
leadingContent = {
HapticRadioButton(
selected = bundleType == BundleType.Remote,
@ -152,7 +152,7 @@ fun SelectBundleTypeStep(
onClick = { onBundleTypeSelected(BundleType.Local) }
),
headlineContent = { Text(stringResource(R.string.select_from_storage)) },
supportingContent = { Text(stringResource(R.string.local_bundle_description)) },
supportingContent = { Text(stringResource(R.string.local_patches_description)) },
overlineContent = { },
leadingContent = {
HapticRadioButton(
@ -185,7 +185,7 @@ fun ImportBundleStep(
) {
ListItem(
headlineContent = {
Text(stringResource(R.string.patch_bundle_field))
Text(stringResource(R.string.patches))
},
supportingContent = { Text(stringResource(if (patchBundle != null) R.string.file_field_set else R.string.file_field_not_set)) },
trailingContent = {
@ -206,7 +206,7 @@ fun ImportBundleStep(
OutlinedTextField(
value = remoteUrl,
onValueChange = onRemoteUrlChange,
label = { Text(stringResource(R.string.bundle_url)) }
label = { Text(stringResource(R.string.patches_url)) }
)
}
Column(

View File

@ -77,7 +77,7 @@ enum class DashboardPage(
val icon: ImageVector
) {
DASHBOARD(R.string.tab_apps, Icons.Outlined.Apps),
BUNDLES(R.string.tab_bundles, Icons.Outlined.Source),
BUNDLES(R.string.tab_patches, Icons.Outlined.Source),
}
@SuppressLint("BatteryLife")
@ -91,7 +91,7 @@ fun DashboardScreen(
onDownloaderPluginClick: () -> Unit,
onAppClick: (String) -> Unit
) {
val bundlesSelectable by remember { derivedStateOf { vm.selectedSources.size > 0 } }
val bundlesSelectable by remember { derivedStateOf { vm.selectedSources.isNotEmpty() } }
val availablePatches by vm.availablePatches.collectAsStateWithLifecycle(0)
val showNewDownloaderPluginsNotification by vm.newDownloaderPluginsAvailable.collectAsStateWithLifecycle(
false
@ -158,7 +158,7 @@ fun DashboardScreen(
topBar = {
if (bundlesSelectable) {
BundleTopBar(
title = stringResource(R.string.bundles_selected, vm.selectedSources.size),
title = stringResource(R.string.patches_selected, vm.selectedSources.size),
onBackClick = vm::cancelSourceSelection,
backIcon = {
Icon(
@ -224,7 +224,7 @@ fun DashboardScreen(
when (pagerState.currentPage) {
DashboardPage.DASHBOARD.ordinal -> {
if (availablePatches < 1) {
androidContext.toast(androidContext.getString(R.string.patches_unavailable))
androidContext.toast(androidContext.getString(R.string.no_patch_found))
composableScope.launch {
pagerState.animateScrollToPage(
DashboardPage.BUNDLES.ordinal

View File

@ -37,13 +37,13 @@ fun DeveloperOptionsScreen(
modifier = Modifier.nestedScroll(scrollBehavior.nestedScrollConnection),
) { paddingValues ->
Column(modifier = Modifier.padding(paddingValues)) {
GroupHeader(stringResource(R.string.patch_bundles_section))
GroupHeader(stringResource(R.string.patches))
SettingsListItem(
headlineContent = stringResource(R.string.patch_bundles_force_download),
headlineContent = stringResource(R.string.patches_force_download),
modifier = Modifier.clickable(onClick = vm::redownloadBundles)
)
SettingsListItem(
headlineContent = stringResource(R.string.patch_bundles_reset),
headlineContent = stringResource(R.string.patches_reset),
modifier = Modifier.clickable(onClick = vm::redownloadBundles)
)
}

View File

@ -203,8 +203,8 @@ fun ImportExportSettingsScreen(
if (patchBundles.size > 1) {
GroupItem(
onClick = { showBundleSelector = true },
headline = R.string.patch_options_reset_bundle,
description = R.string.patch_options_reset_bundle_description,
headline = R.string.patch_options_reset_patches,
description = R.string.patch_options_reset_patches_description,
)
}
}

View File

@ -135,13 +135,13 @@ class DashboardViewModel(
uiSafe(
app,
R.string.source_download_fail,
R.string.patches_download_fail,
RemotePatchBundle.updateFailMsg
) {
if (bundle.update())
app.toast(app.getString(R.string.bundle_update_success, bundle.getName()))
app.toast(app.getString(R.string.patches_update_success, bundle.getName()))
else
app.toast(app.getString(R.string.bundle_update_unavailable, bundle.getName()))
app.toast(app.getString(R.string.patches_update_unavailable, bundle.getName()))
}
}
}

View File

@ -16,7 +16,7 @@ class DeveloperOptionsViewModel(
private val patchBundleRepository: PatchBundleRepository
) : ViewModel() {
fun redownloadBundles() = viewModelScope.launch {
uiSafe(app, R.string.source_download_fail, RemotePatchBundle.updateFailMsg) {
uiSafe(app, R.string.patches_download_fail, RemotePatchBundle.updateFailMsg) {
patchBundleRepository.redownloadRemoteBundles()
}
}

View File

@ -14,26 +14,24 @@
<string name="dashboard">Dashboard</string>
<string name="settings">Settings</string>
<string name="select_app">Select an app</string>
<string name="patches_selected">%1$d/%2$d selected</string>
<string name="patches_count_selected">%1$d/%2$d selected</string>
<string name="new_downloader_plugins_notification">New downloader plugins available. Click here to configure them.</string>
<string name="unsupported_architecture_warning">Patching on this device architecture is unsupported and will most likely fail.</string>
<string name="import_">Import</string>
<string name="import_bundle">Import patch bundle</string>
<string name="bundle_patches">Bundle patches</string>
<string name="patch_bundle_field">Patch bundle</string>
<string name="import_patches">Import patches</string>
<string name="file_field_set">Selected</string>
<string name="file_field_not_set">Not selected</string>
<string name="field_not_set">Not set</string>
<string name="bundle_missing">Missing</string>
<string name="bundle_error">Error</string>
<string name="bundle_error_description">Bundle could not be loaded. Click to view the error</string>
<string name="bundle_not_downloaded">Bundle has not been downloaded. Click here to download it</string>
<string name="bundle_name_default">Default</string>
<string name="bundle_name_fallback">Unnamed</string>
<string name="patches_missing">Missing</string>
<string name="patches_error">Error</string>
<string name="patches_error_description">Patches could not be loaded. Click to view the error</string>
<string name="patches_not_downloaded">Patches has not been downloaded. Click here to download it</string>
<string name="patches_name_default">Patches</string>
<string name="patches_name_fallback">Unnamed</string>
<string name="android_11_bug_dialog_title">Android 11 bug</string>
<string name="android_11_bug_dialog_description">The app installation permission must be granted ahead of time to avoid a bug in the Android 11 system that will negatively affect the user experience.</string>
@ -132,8 +130,8 @@
<string name="reset_patch_selection_success">Patch selection has been reset</string>
<string name="patch_options_reset_package">Reset patch options for app</string>
<string name="patch_options_reset_package_description">Resets patch options for a single app</string>
<string name="patch_options_reset_bundle">Resets patch options for bundle</string>
<string name="patch_options_reset_bundle_description">Resets patch options for all patches in a bundle</string>
<string name="patch_options_reset_patches">Resets patch options for this patches</string>
<string name="patch_options_reset_patches_description">Resets patch options for all patches</string>
<string name="patch_options_reset_all">Reset patch options</string>
<string name="patch_options_reset_all_description">Resets all patch options</string>
<string name="downloader_plugins">Plugins</string>
@ -147,7 +145,7 @@
<string name="search_apps">Search apps…</string>
<string name="loading_body">Loading…</string>
<string name="downloading_patches">Downloading patch bundle…</string>
<string name="downloading_patches">Downloading patches</string>
<string name="options">Options</string>
<string name="ok">OK</string>
@ -185,8 +183,8 @@
<string name="debug_logs_export_success">Exported logs</string>
<string name="api_url">API URL</string>
<string name="api_url_description">The API used to download necessary files.</string>
<string name="api_url_dialog_title">Set custom API URL</string>
<string name="api_url_dialog_description">Set the API URL of ReVanced Manager. ReVanced Manager uses the API to download patches and updates.</string>
<string name="api_url_dialog_title">Change API URL</string>
<string name="api_url_dialog_description">Change the API URL of ReVanced Manager. ReVanced Manager uses the API to download patches and updates.</string>
<string name="api_url_dialog_warning">ReVanced Manager connects to the API to download patches and updates. Make sure that you trust it.</string>
<string name="api_url_dialog_save">Set</string>
<string name="api_url_dialog_reset">Reset API URL</string>
@ -196,26 +194,25 @@
<string name="device_architectures">CPU Architectures</string>
<string name="device_memory_limit">Memory limits</string>
<string name="device_memory_limit_format">%1$dMB (Normal) - %2$dMB (Large)</string>
<string name="patch_bundles_section">Patch bundles</string>
<string name="patch_bundles_force_download">Force download all patch bundles</string>
<string name="patch_bundles_reset">Reset patch bundles</string>
<string name="patches_force_download">Force download all patches</string>
<string name="patches_reset">Reset patches</string>
<string name="patching">Patching</string>
<string name="signing">Signing</string>
<string name="storage">Storage</string>
<string name="patches_unavailable">No patches are available. Check your bundles</string>
<string name="no_patch_found">No patch can be found. Check your patches</string>
<string name="tab_apps">Apps</string>
<string name="tab_bundles">Patch bundles</string>
<string name="tab_patches">Patches</string>
<string name="delete">Delete</string>
<string name="refresh">Refresh</string>
<string name="continue_anyways">Continue anyways</string>
<string name="download_another_version">Download another version</string>
<string name="download_app">Download app</string>
<string name="download_apk">Download APK file</string>
<string name="source_download_fail">Failed to download patch bundle: %s</string>
<string name="source_replace_fail">Failed to load updated patch bundle: %s</string>
<string name="patches_download_fail">Failed to download patches: %s</string>
<string name="patches_replace_fail">Failed to load updated patches: %s</string>
<string name="no_patched_apps_found">No patched apps found</string>
<string name="tap_on_patches">Tap on the patches to get more information about them</string>
<string name="bundles_selected">%s selected</string>
<string name="patches_selected">%s selected</string>
<string name="incompatible_patches">Incompatible patches</string>
<string name="universal_patches">Universal patches</string>
<string name="patch_selection_reset_toast">Patch selection and options has been reset to recommended defaults</string>
@ -328,14 +325,11 @@
<string name="submit_feedback_description">Help us improve this application</string>
<string name="developer_options">Developer options</string>
<string name="developer_options_description">Options for debugging issues</string>
<string name="bundle_input_source_url">Source URL</string>
<string name="bundle_update_success">Successfully updated %s</string>
<string name="bundle_update_unavailable">No update available for %s</string>
<string name="bundle_auto_update">Auto update</string>
<string name="bundle_auto_update_description">Automatically update this bundle when ReVanced starts</string>
<string name="bundle_view_patches">View patches</string>
<string name="bundle_view_patches_any_version">Any version</string>
<string name="bundle_view_patches_any_package">Any package</string>
<string name="patches_update_success">Successfully updated %s</string>
<string name="patches_update_unavailable">No update available for %s</string>
<string name="patches_view">View patches</string>
<string name="patches_view_any_version">Any version</string>
<string name="patches_view_any_package">Any package</string>
<string name="about_revanced_manager">About ReVanced Manager</string>
<string name="revanced_manager_description">ReVanced Manager is an application designed to work with ReVanced Patcher, which allows for long-lasting patches to be created for Android apps. The patching system is designed to automatically work with new versions of apps with minimal maintenance.</string>
@ -386,10 +380,9 @@
<string name="no_contributors_found">No contributors found</string>
<string name="select">Select</string>
<string name="select_deselect_all">Select or deselect all</string>
<string name="select_bundle_type_dialog_title">Add new bundle</string>
<string name="select_bundle_type_dialog_description">Add a new bundle from a URL or storage</string>
<string name="local_bundle_description">Import local files from your storage, does not automatically update</string>
<string name="remote_bundle_description">Import remote files from a URL, can automatically update</string>
<string name="select_patches_type_dialog_description">Add new patches from URL or local files</string>
<string name="local_patches_description">Add patches from local storage.</string>
<string name="remote_patches_description">Add patches from URL. Patches can automatically update.</string>
<string name="recommended">Recommended</string>
<string name="installation_failed_dialog_title">Installation failed</string>
@ -414,9 +407,10 @@
<string name="about_device">About device</string>
<string name="enter_url">Enter URL</string>
<string name="next">Next</string>
<string name="add_patch_bundle">Add patch bundle</string>
<string name="bundle_url">Bundle URL</string>
<string name="auto_update">Auto update</string>
<string name="add_patches">Add patches</string>
<string name="auto_update_description">Automatically update when a new version is available</string>
<string name="patches_url">Patches URL</string>
<string name="incompatible_patches_dialog">These patches are not compatible with the selected app version (%1$s).\n\nClick on the patches to see more details.</string>
<string name="incompatible_patch">Incompatible patch</string>
<string name="any_version">Any</string>