From 6a55edcaa7d23f17190705c181a2435c33cde51a Mon Sep 17 00:00:00 2001 From: kitsunyan Date: Sun, 19 Jul 2020 02:52:09 +0300 Subject: [PATCH] Further rework strings --- src/main/AndroidManifest.xml | 2 +- .../screen/EditRepositoryFragment.kt | 6 +- .../foxydroid/screen/MessageDialog.kt | 26 ++-- .../foxydroid/screen/PreferencesFragment.kt | 6 +- .../foxydroid/screen/ProductAdapter.kt | 78 +++++----- .../foxydroid/screen/ProductsFragment.kt | 8 +- .../foxydroid/screen/RepositoryFragment.kt | 4 +- .../foxydroid/screen/TabsFragment.kt | 4 +- .../foxydroid/service/DownloadService.kt | 41 +++-- .../foxydroid/service/SyncService.kt | 24 +-- src/main/res/values/strings.xml | 145 +++++++++--------- 11 files changed, 171 insertions(+), 173 deletions(-) diff --git a/src/main/AndroidManifest.xml b/src/main/AndroidManifest.xml index f13600c..11237ad 100644 --- a/src/main/AndroidManifest.xml +++ b/src/main/AndroidManifest.xml @@ -12,7 +12,7 @@ (parentFragment as EditRepositoryFragment) .setMirror(mirrors[position]) } .setNegativeButton(R.string.cancel, null) diff --git a/src/main/kotlin/nya/kitsunyan/foxydroid/screen/MessageDialog.kt b/src/main/kotlin/nya/kitsunyan/foxydroid/screen/MessageDialog.kt index 32e03bc..1ac9a61 100644 --- a/src/main/kotlin/nya/kitsunyan/foxydroid/screen/MessageDialog.kt +++ b/src/main/kotlin/nya/kitsunyan/foxydroid/screen/MessageDialog.kt @@ -126,19 +126,19 @@ class MessageDialog(): DialogFragment() { val dialog = AlertDialog.Builder(requireContext()) when (val message = requireArguments().getParcelable(EXTRA_MESSAGE)!!) { is Message.DeleteRepositoryConfirm -> { - dialog.setTitle(R.string.confirm_action) - dialog.setMessage(R.string.delete_repository_confirm) + dialog.setTitle(R.string.confirmation) + dialog.setMessage(R.string.delete_repository_DESC) dialog.setPositiveButton(R.string.delete) { _, _ -> (parentFragment as RepositoryFragment).onDeleteConfirm() } dialog.setNegativeButton(R.string.cancel, null) } is Message.CantEditSyncing -> { dialog.setTitle(R.string.action_failed) - dialog.setMessage(R.string.cant_edit_sync_description) + dialog.setMessage(R.string.cant_edit_sync_DESC) dialog.setPositiveButton(R.string.ok, null) } is Message.Link -> { - dialog.setTitle(R.string.confirm_action) - dialog.setMessage(getString(R.string.open_link_confirm_format, message.uri.toString())) + dialog.setTitle(R.string.confirmation) + dialog.setMessage(getString(R.string.open_DESC_FORMAT, message.uri.toString())) dialog.setPositiveButton(R.string.ok) { _, _ -> try { startActivity(Intent(Intent.ACTION_VIEW, message.uri)) @@ -177,7 +177,7 @@ class MessageDialog(): DialogFragment() { if (builder.isNotEmpty()) { builder.delete(builder.length - 2, builder.length) } else { - builder.append(getString(R.string.no_description_available_description)) + builder.append(getString(R.string.no_description_available_DESC)) } dialog.setTitle(title) dialog.setMessage(builder) @@ -190,19 +190,19 @@ class MessageDialog(): DialogFragment() { val maxSdkVersion = if (Release.Incompatibility.MaxSdk in message.incompatibilities) message.maxSdkVersion else null if (minSdkVersion != null || maxSdkVersion != null) { - val versionMessage = minSdkVersion?.let { getString(R.string.incompatible_sdk_min_description_format, it) } - ?: maxSdkVersion?.let { getString(R.string.incompatible_sdk_max_description_format, it) } - builder.append(getString(R.string.incompatible_sdk_description_format, + val versionMessage = minSdkVersion?.let { getString(R.string.incompatible_api_min_DESC_FORMAT, it) } + ?: maxSdkVersion?.let { getString(R.string.incompatible_api_max_DESC_FORMAT, it) } + builder.append(getString(R.string.incompatible_api_DESC_FORMAT, Android.name, Android.sdk, versionMessage.orEmpty())).append("\n\n") } if (Release.Incompatibility.Platform in message.incompatibilities) { - builder.append(getString(R.string.incompatible_platforms_description_format, + builder.append(getString(R.string.incompatible_platforms_DESC_FORMAT, Android.primaryPlatform ?: getString(R.string.unknown), message.platforms.joinToString(separator = ", "))).append("\n\n") } val features = message.incompatibilities.mapNotNull { it as? Release.Incompatibility.Feature } if (features.isNotEmpty()) { - builder.append(getString(R.string.incompatible_features_description)) + builder.append(getString(R.string.incompatible_features_DESC)) for (feature in features) { builder.append("\n\u2022 ").append(feature.feature) } @@ -217,12 +217,12 @@ class MessageDialog(): DialogFragment() { } is Message.ReleaseOlder -> { dialog.setTitle(R.string.incompatible_version) - dialog.setMessage(R.string.incompatible_older_description) + dialog.setMessage(R.string.incompatible_older_DESC) dialog.setPositiveButton(R.string.ok, null) } is Message.ReleaseSignatureMismatch -> { dialog.setTitle(R.string.incompatible_version) - dialog.setMessage(R.string.incompatible_signature_description) + dialog.setMessage(R.string.incompatible_signature_DESC) dialog.setPositiveButton(R.string.ok, null) } }::class diff --git a/src/main/kotlin/nya/kitsunyan/foxydroid/screen/PreferencesFragment.kt b/src/main/kotlin/nya/kitsunyan/foxydroid/screen/PreferencesFragment.kt index c5b0fd8..7078feb 100644 --- a/src/main/kotlin/nya/kitsunyan/foxydroid/screen/PreferencesFragment.kt +++ b/src/main/kotlin/nya/kitsunyan/foxydroid/screen/PreferencesFragment.kt @@ -54,12 +54,12 @@ class PreferencesFragment: ScreenFragment() { addEnumeration(Preferences.Key.AutoSync, getString(R.string.sync_repositories_automatically)) { when (it) { Preferences.AutoSync.Never -> getString(R.string.never) - Preferences.AutoSync.Wifi -> getString(R.string.over_wifi) + Preferences.AutoSync.Wifi -> getString(R.string.only_on_wifi) Preferences.AutoSync.Always -> getString(R.string.always) } } - addSwitch(Preferences.Key.UpdateNotify, getString(R.string.update_notifications), - getString(R.string.update_notifications_summary)) + addSwitch(Preferences.Key.UpdateNotify, getString(R.string.notify_about_updates), + getString(R.string.notify_about_updates_summary)) addSwitch(Preferences.Key.UpdateUnstable, getString(R.string.unstable_updates), getString(R.string.unstable_updates_summary)) } diff --git a/src/main/kotlin/nya/kitsunyan/foxydroid/screen/ProductAdapter.kt b/src/main/kotlin/nya/kitsunyan/foxydroid/screen/ProductAdapter.kt index edd6a4d..f9ddf28 100644 --- a/src/main/kotlin/nya/kitsunyan/foxydroid/screen/ProductAdapter.kt +++ b/src/main/kotlin/nya/kitsunyan/foxydroid/screen/ProductAdapter.kt @@ -102,24 +102,24 @@ class ProductAdapter(private val callbacks: Callbacks, private val columns: Int) private enum class SectionType(val titleResId: Int, val colorAttrResId: Int) { ANTI_FEATURES(R.string.anti_features, R.attr.colorError), - WHATS_NEW(R.string.whats_new, android.R.attr.colorAccent), + CHANGES(R.string.changes, android.R.attr.colorAccent), LINKS(R.string.links, android.R.attr.colorAccent), DONATE(R.string.donate, android.R.attr.colorAccent), PERMISSIONS(R.string.permissions, android.R.attr.colorAccent), SCREENSHOTS(R.string.screenshots, android.R.attr.colorAccent), - RELEASES(R.string.releases, android.R.attr.colorAccent) + VERSIONS(R.string.versions, android.R.attr.colorAccent) } - internal enum class ExpandType { NOTHING, DESCRIPTION, WHATS_NEW, - LINKS, DONATES, PERMISSIONS, SCREENSHOTS, RELEASES } - private enum class TextType { DESCRIPTION, ANTI_FEATURES, WHATS_NEW } + internal enum class ExpandType { NOTHING, DESCRIPTION, CHANGES, + LINKS, DONATES, PERMISSIONS, SCREENSHOTS, VERSIONS } + private enum class TextType { DESCRIPTION, ANTI_FEATURES, CHANGES } private enum class LinkType(val iconResId: Int, val titleResId: Int, val format: ((Context, String) -> String)? = null) { - AUTHOR(R.drawable.ic_person, R.string.authors_website), - EMAIL(R.drawable.ic_email, R.string.authors_email), + AUTHOR(R.drawable.ic_person, R.string.author_website), + EMAIL(R.drawable.ic_email, R.string.author_email), LICENSE(R.drawable.ic_copyright, R.string.license, - format = { context, text -> context.getString(R.string.license_format, text) }), + format = { context, text -> context.getString(R.string.license_FORMAT, text) }), SOURCE(R.drawable.ic_code, R.string.source_code), TRACKER(R.drawable.ic_bug_report, R.string.bug_tracker), CHANGELOG(R.drawable.ic_history, R.string.changelog), @@ -636,18 +636,18 @@ class ProductAdapter(private val callbacks: Callbacks, private val columns: Int) val antiFeatures = productRepository.first.antiFeatures.map { when (it) { - "Ads" -> context.getString(R.string.anti_feature_advertising) - "ApplicationDebuggable" -> context.getString(R.string.anti_feature_application_debuggable) - "DisabledAlgorithm" -> context.getString(R.string.anti_feature_disabled_algorithm) - "KnownVuln" -> context.getString(R.string.anti_feature_known_vulnerabilities) - "NoSourceSince" -> context.getString(R.string.anti_feature_no_source_since) - "NonFreeAdd" -> context.getString(R.string.anti_feature_non_free_addons) - "NonFreeAssets" -> context.getString(R.string.anti_feature_non_free_assets) - "NonFreeDep" -> context.getString(R.string.anti_feature_non_free_dependencies) - "NonFreeNet" -> context.getString(R.string.anti_feature_non_free_network) - "Tracking" -> context.getString(R.string.anti_feature_tracking) - "UpstreamNonFree" -> context.getString(R.string.anti_feature_upstream_non_free) - else -> context.getString(R.string.unknown_format, it) + "Ads" -> context.getString(R.string.has_advertising) + "ApplicationDebuggable" -> context.getString(R.string.compiled_for_debugging) + "DisabledAlgorithm" -> context.getString(R.string.signed_using_unsafe_algorithm) + "KnownVuln" -> context.getString(R.string.has_security_vulnerabilities) + "NoSourceSince" -> context.getString(R.string.source_code_no_longer_available) + "NonFreeAdd" -> context.getString(R.string.promotes_non_free_software) + "NonFreeAssets" -> context.getString(R.string.contains_non_free_media) + "NonFreeDep" -> context.getString(R.string.has_non_free_dependencies) + "NonFreeNet" -> context.getString(R.string.promotes_non_free_network_services) + "Tracking" -> context.getString(R.string.tracks_or_reports_your_activity) + "UpstreamNonFree" -> context.getString(R.string.upstream_source_code_is_not_free) + else -> context.getString(R.string.unknown_FORMAT, it) } }.joinToString(separator = "\n") { "\u2022 $it" } if (antiFeatures.isNotEmpty()) { @@ -655,14 +655,14 @@ class ProductAdapter(private val callbacks: Callbacks, private val columns: Int) items += Item.TextItem(TextType.ANTI_FEATURES, antiFeatures) } - val whatsNew = formatHtml(productRepository.first.whatsNew) - if (whatsNew.isNotEmpty()) { - items += Item.SectionItem(SectionType.WHATS_NEW) - val cropped = if (ExpandType.WHATS_NEW !in expanded) whatsNew.lineCropped(12, 10) else null - val item = Item.TextItem(TextType.WHATS_NEW, whatsNew) + val changes = formatHtml(productRepository.first.whatsNew) + if (changes.isNotEmpty()) { + items += Item.SectionItem(SectionType.CHANGES) + val cropped = if (ExpandType.CHANGES !in expanded) changes.lineCropped(12, 10) else null + val item = Item.TextItem(TextType.CHANGES, changes) if (cropped != null) { - items += listOf(Item.TextItem(TextType.WHATS_NEW, cropped), - Item.ExpandItem(ExpandType.WHATS_NEW, true, listOf(item))) + items += listOf(Item.TextItem(TextType.CHANGES, cropped), + Item.ExpandItem(ExpandType.CHANGES, true, listOf(item))) } else { items += item } @@ -758,11 +758,11 @@ class ProductAdapter(private val callbacks: Callbacks, private val columns: Int) .sortedByDescending { it.release.versionCode } .toList() if (releaseItems.isNotEmpty()) { - items += Item.SectionItem(SectionType.RELEASES) + items += Item.SectionItem(SectionType.VERSIONS) val maxReleases = 5 - if (releaseItems.size > maxReleases && ExpandType.RELEASES !in expanded) { + if (releaseItems.size > maxReleases && ExpandType.VERSIONS !in expanded) { items += releaseItems.take(maxReleases) - items += Item.ExpandItem(ExpandType.RELEASES, false, releaseItems.takeLast(releaseItems.size - maxReleases)) + items += Item.ExpandItem(ExpandType.VERSIONS, false, releaseItems.takeLast(releaseItems.size - maxReleases)) } else { items += releaseItems } @@ -975,7 +975,7 @@ class ProductAdapter(private val callbacks: Callbacks, private val columns: Int) !ProductPreferences[item.product.packageName].shouldIgnoreUpdate(item.product.versionCode) val version = (if (canUpdate) item.product.version else installedItem?.version)?.nullIfEmpty() ?: item.product.version.nullIfEmpty() - holder.version.text = version?.let { context.getString(R.string.version_format, it) } + holder.version.text = version?.let { context.getString(R.string.version_FORMAT, it) } ?: context.getString(R.string.unknown) holder.packageName.text = item.product.packageName val action = action @@ -1002,7 +1002,7 @@ class ProductAdapter(private val callbacks: Callbacks, private val columns: Int) holder.progress.isIndeterminate = true } is Status.Downloading -> { - holder.status.text = context.getString(R.string.downloading_format, if (status.total == null) + holder.status.text = context.getString(R.string.downloading_FORMAT, if (status.total == null) status.read.formatSize() else "${status.read.formatSize()} / ${status.total.formatSize()}") holder.progress.isIndeterminate = status.total == null if (status.total != null) { @@ -1051,7 +1051,7 @@ class ProductAdapter(private val callbacks: Callbacks, private val columns: Int) holder as ExpandViewHolder item as Item.ExpandItem holder.text.setText(when (item.expandType) { - ExpandType.RELEASES -> R.string.show_older_releases + ExpandType.VERSIONS -> R.string.show_older_versions else -> R.string.show_more }) } @@ -1154,7 +1154,7 @@ class ProductAdapter(private val callbacks: Callbacks, private val columns: Int) val grayOut = incompatibility != null || olderOrSignature val primarySecondaryColor = context.getColorFromAttr(if (grayOut) android.R.attr.textColorSecondary else android.R.attr.textColorPrimary) - holder.version.text = context.getString(R.string.version_format, item.release.version) + holder.version.text = context.getString(R.string.version_FORMAT, item.release.version) holder.version.setTextColor(primarySecondaryColor) holder.setStatusActive(!grayOut) holder.status.visibility = if (installed || suggested) View.VISIBLE else View.GONE @@ -1163,7 +1163,7 @@ class ProductAdapter(private val callbacks: Callbacks, private val columns: Int) suggested -> R.string.suggested else -> R.string.unknown }) - holder.source.text = context.getString(R.string.provided_by_format, item.repository.name) + holder.source.text = context.getString(R.string.provided_by_FORMAT, item.repository.name) holder.added.text = holder.dateFormat.format(item.release.added) holder.added.setTextColor(primarySecondaryColor) holder.size.text = item.release.size.formatSize() @@ -1173,14 +1173,14 @@ class ProductAdapter(private val callbacks: Callbacks, private val columns: Int) holder.compatibility.setTextColor(context.getColorFromAttr(R.attr.colorError)) holder.compatibility.text = when (incompatibility) { is Release.Incompatibility.MinSdk, - is Release.Incompatibility.MaxSdk -> context.getString(R.string.incompatible_with_format, Android.name) - is Release.Incompatibility.Platform -> context.getString(R.string.incompatible_with_format, + is Release.Incompatibility.MaxSdk -> context.getString(R.string.incompatible_with_FORMAT, Android.name) + is Release.Incompatibility.Platform -> context.getString(R.string.incompatible_with_FORMAT, Android.primaryPlatform ?: context.getString(R.string.unknown)) - is Release.Incompatibility.Feature -> context.getString(R.string.requires_format, incompatibility.feature) + is Release.Incompatibility.Feature -> context.getString(R.string.requires_FORMAT, incompatibility.feature) } } else if (singlePlatform != null) { holder.compatibility.setTextColor(context.getColorFromAttr(android.R.attr.textColorSecondary)) - holder.compatibility.text = context.getString(R.string.compatible_with_only_format, singlePlatform) + holder.compatibility.text = context.getString(R.string.only_compatible_with_FORMAT, singlePlatform) } val enabled = status == null holder.statefulViews.forEach { it.isEnabled = enabled } diff --git a/src/main/kotlin/nya/kitsunyan/foxydroid/screen/ProductsFragment.kt b/src/main/kotlin/nya/kitsunyan/foxydroid/screen/ProductsFragment.kt index df44eb7..b339b02 100644 --- a/src/main/kotlin/nya/kitsunyan/foxydroid/screen/ProductsFragment.kt +++ b/src/main/kotlin/nya/kitsunyan/foxydroid/screen/ProductsFragment.kt @@ -131,11 +131,11 @@ class ProductsFragment(): ScreenFragment(), CursorOwner.Callback { this.cursor = cursor emptyText = when { cursor == null -> "" - searchQuery.isNotEmpty() -> getString(R.string.empty_search_summary) + searchQuery.isNotEmpty() -> getString(R.string.no_matching_applications_found) else -> when (source) { - Source.AVAILABLE -> getString(R.string.available_empty_summary) - Source.INSTALLED -> getString(R.string.installed_empty_summary) - Source.UPDATES -> getString(R.string.updates_empty_summary) + Source.AVAILABLE -> getString(R.string.no_applications_available) + Source.INSTALLED -> getString(R.string.no_applications_installed) + Source.UPDATES -> getString(R.string.all_applications_up_to_date) } } } diff --git a/src/main/kotlin/nya/kitsunyan/foxydroid/screen/RepositoryFragment.kt b/src/main/kotlin/nya/kitsunyan/foxydroid/screen/RepositoryFragment.kt index 0cb43c6..4275b7b 100644 --- a/src/main/kotlin/nya/kitsunyan/foxydroid/screen/RepositoryFragment.kt +++ b/src/main/kotlin/nya/kitsunyan/foxydroid/screen/RepositoryFragment.kt @@ -128,11 +128,11 @@ class RepositoryFragment(): ScreenFragment() { Database.ProductAdapter.getCount(repository.id).toString()) } } else { - layout.addTitleText(R.string.description, getString(R.string.not_updated_description)) + layout.addTitleText(R.string.description, getString(R.string.repository_not_used_DESC)) } if (repository.fingerprint.isEmpty()) { if (repository.updated > 0L) { - val builder = SpannableStringBuilder(getString(R.string.unsigned_description)) + val builder = SpannableStringBuilder(getString(R.string.repository_unsigned_DESC)) builder.setSpan(ForegroundColorSpan(layout.context.getColorFromAttr(R.attr.colorError).defaultColor), 0, builder.length, SpannableStringBuilder.SPAN_EXCLUSIVE_EXCLUSIVE) layout.addTitleText(R.string.fingerprint, builder) diff --git a/src/main/kotlin/nya/kitsunyan/foxydroid/screen/TabsFragment.kt b/src/main/kotlin/nya/kitsunyan/foxydroid/screen/TabsFragment.kt index 961ae18..314c546 100644 --- a/src/main/kotlin/nya/kitsunyan/foxydroid/screen/TabsFragment.kt +++ b/src/main/kotlin/nya/kitsunyan/foxydroid/screen/TabsFragment.kt @@ -115,7 +115,7 @@ class TabsFragment: ScreenFragment() { val toolbar = view.findViewById(R.id.toolbar)!! screenActivity.onToolbarCreated(toolbar) - toolbar.setTitle(R.string.app_name) + toolbar.setTitle(R.string.application_name) // Move focus from SearchView to Toolbar toolbar.isFocusableInTouchMode = true @@ -147,7 +147,7 @@ class TabsFragment: ScreenFragment() { .setActionView(searchView) .setShowAsActionFlags(MenuItem.SHOW_AS_ACTION_ALWAYS or MenuItem.SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW) - sortOrderMenu = addSubMenu(0, 0, 0, R.string.sort_order) + sortOrderMenu = addSubMenu(0, 0, 0, R.string.sorting_order) .setIcon(Utils.getToolbarIcon(toolbar.context, R.drawable.ic_sort)) .let { menu -> menu.item.setShowAsActionFlags(MenuItem.SHOW_AS_ACTION_ALWAYS) diff --git a/src/main/kotlin/nya/kitsunyan/foxydroid/service/DownloadService.kt b/src/main/kotlin/nya/kitsunyan/foxydroid/service/DownloadService.kt index 3214bcb..7c4c4e2 100644 --- a/src/main/kotlin/nya/kitsunyan/foxydroid/service/DownloadService.kt +++ b/src/main/kotlin/nya/kitsunyan/foxydroid/service/DownloadService.kt @@ -174,7 +174,7 @@ class DownloadService: ConnectionService() { } } - private enum class ValidationError { HASH, STRUCTURE, INTEGRITY, SIGNATURE, PERMISSIONS } + private enum class ValidationError { INTEGRITY, FORMAT, METADATA, SIGNATURE, PERMISSIONS } private sealed class ErrorType { object Network: ErrorType() @@ -194,23 +194,22 @@ class DownloadService: ConnectionService() { .apply { when (errorType) { is ErrorType.Network -> { - setContentTitle(getString(R.string.error_downloading_format, task.name)) - setContentText(getString(R.string.network_error_description)) + setContentTitle(getString(R.string.could_not_download_FORMAT, task.name)) + setContentText(getString(R.string.network_error_DESC)) } is ErrorType.Http -> { - setContentTitle(getString(R.string.error_downloading_format, task.name)) - setContentText(getString(R.string.http_error_description)) + setContentTitle(getString(R.string.could_not_download_FORMAT, task.name)) + setContentText(getString(R.string.http_error_DESC)) } is ErrorType.Validation -> { - setContentTitle(getString(R.string.error_validating_format, task.name)) - val resId = R.string.validation_package_error_description_format - setContentText(getString(resId, getString(when (errorType.validateError) { - ValidationError.HASH -> R.string.validation_error_hash_lower - ValidationError.STRUCTURE -> R.string.validation_error_structure_lower - ValidationError.INTEGRITY -> R.string.validation_error_integrity_lower - ValidationError.SIGNATURE -> R.string.validation_error_signature_lower - ValidationError.PERMISSIONS -> R.string.validation_error_permissions_lower - }))) + setContentTitle(getString(R.string.could_not_validate_FORMAT, task.name)) + setContentText(getString(when (errorType.validateError) { + ValidationError.INTEGRITY -> R.string.integrity_check_error_DESC + ValidationError.FORMAT -> R.string.file_format_error_DESC + ValidationError.METADATA -> R.string.invalid_metadata_error_DESC + ValidationError.SIGNATURE -> R.string.invalid_signature_error_DESC + ValidationError.PERMISSIONS -> R.string.invalid_permissions_error_DESC + })) } }::class } @@ -227,8 +226,8 @@ class DownloadService: ConnectionService() { .setContentIntent(PendingIntent.getBroadcast(this, 0, Intent(this, Receiver::class.java) .setAction("$ACTION_INSTALL.${task.packageName}") .putExtra(EXTRA_CACHE_FILE_NAME, task.release.cacheFileName), PendingIntent.FLAG_UPDATE_CURRENT)) - .setContentTitle(getString(R.string.finished_downloading_format, task.name)) - .setContentText(getString(R.string.tap_to_install_description)) + .setContentTitle(getString(R.string.downloaded_FORMAT, task.name)) + .setContentText(getString(R.string.tap_to_install_DESC)) .build()) } @@ -253,7 +252,7 @@ class DownloadService: ConnectionService() { "" } return if (hash.isEmpty() || hash != task.release.hash) { - ValidationError.HASH + ValidationError.INTEGRITY } else { val packageInfo = try { packageManager.getPackageArchiveInfo(file.path, Android.PackageManager.signaturesFlag) @@ -262,10 +261,10 @@ class DownloadService: ConnectionService() { null } if (packageInfo == null) { - ValidationError.STRUCTURE + ValidationError.FORMAT } else if (packageInfo.packageName != task.packageName || packageInfo.versionCodeCompat != task.release.versionCode) { - ValidationError.INTEGRITY + ValidationError.METADATA } else { val signature = packageInfo.singleSignature?.let(Utils::calculateHash).orEmpty() if (signature.isEmpty() || signature != task.release.signature) { @@ -296,12 +295,12 @@ class DownloadService: ConnectionService() { startForeground(Common.NOTIFICATION_ID_SYNCING, stateNotificationBuilder.apply { when (state) { is State.Connecting -> { - setContentTitle(getString(R.string.downloading_format, state.name)) + setContentTitle(getString(R.string.downloading_FORMAT, state.name)) setContentText(getString(R.string.connecting)) setProgress(1, 0, true) } is State.Downloading -> { - setContentTitle(getString(R.string.downloading_format, state.name)) + setContentTitle(getString(R.string.downloading_FORMAT, state.name)) if (state.total != null) { setContentText("${state.read.formatSize()} / ${state.total.formatSize()}") setProgress(100, (100f * state.read / state.total).roundToInt(), false) diff --git a/src/main/kotlin/nya/kitsunyan/foxydroid/service/SyncService.kt b/src/main/kotlin/nya/kitsunyan/foxydroid/service/SyncService.kt index 138d5bc..dd23527 100644 --- a/src/main/kotlin/nya/kitsunyan/foxydroid/service/SyncService.kt +++ b/src/main/kotlin/nya/kitsunyan/foxydroid/service/SyncService.kt @@ -201,15 +201,15 @@ class SyncService: ConnectionService() { .setSmallIcon(android.R.drawable.stat_sys_warning) .setColor(ContextThemeWrapper(this, R.style.Theme_Main_Light) .getColorFromAttr(android.R.attr.colorAccent).defaultColor) - .setContentTitle(getString(R.string.error_syncing_format, repository.name)) + .setContentTitle(getString(R.string.could_not_sync_FORMAT, repository.name)) .setContentText(getString(when (exception) { is RepositoryUpdater.UpdateException -> when (exception.errorType) { - RepositoryUpdater.ErrorType.NETWORK -> R.string.network_error_description - RepositoryUpdater.ErrorType.HTTP -> R.string.http_error_description - RepositoryUpdater.ErrorType.VALIDATION -> R.string.validation_index_error_description - RepositoryUpdater.ErrorType.PARSING -> R.string.parsing_index_error_description + RepositoryUpdater.ErrorType.NETWORK -> R.string.network_error_DESC + RepositoryUpdater.ErrorType.HTTP -> R.string.http_error_DESC + RepositoryUpdater.ErrorType.VALIDATION -> R.string.validation_index_error_DESC + RepositoryUpdater.ErrorType.PARSING -> R.string.parsing_index_error_DESC } - else -> R.string.unknown_error_description + else -> R.string.unknown_error_DESC })) .build()) } @@ -229,12 +229,12 @@ class SyncService: ConnectionService() { startForeground(Common.NOTIFICATION_ID_SYNCING, stateNotificationBuilder.apply { when (state) { is State.Connecting -> { - setContentTitle(getString(R.string.syncing_format, state.name)) + setContentTitle(getString(R.string.syncing_FORMAT, state.name)) setContentText(getString(R.string.connecting)) setProgress(0, 0, true) } is State.Syncing -> { - setContentTitle(getString(R.string.syncing_format, state.name)) + setContentTitle(getString(R.string.syncing_FORMAT, state.name)) when (state.stage) { RepositoryUpdater.Stage.DOWNLOAD -> { if (state.total != null) { @@ -247,12 +247,12 @@ class SyncService: ConnectionService() { } RepositoryUpdater.Stage.PROCESS -> { val progress = state.total?.let { 100f * state.read / it }?.roundToInt() - setContentText(getString(R.string.processing_format, "${progress ?: 0}%")) + setContentText(getString(R.string.processing_FORMAT, "${progress ?: 0}%")) setProgress(100, progress ?: 0, progress == null) } RepositoryUpdater.Stage.MERGE -> { val progress = (100f * state.read / (state.total ?: state.read)).roundToInt() - setContentText(getString(R.string.merging_format, "${state.read} / ${state.total ?: state.read}")) + setContentText(getString(R.string.merging_FORMAT, "${state.read} / ${state.total ?: state.read}")) setProgress(100, progress, false) } RepositoryUpdater.Stage.COMMIT -> { @@ -350,7 +350,7 @@ class SyncService: ConnectionService() { .Builder(this, Common.NOTIFICATION_CHANNEL_UPDATES) .setSmallIcon(R.drawable.ic_new_releases) .setContentTitle(getString(R.string.new_updates_available)) - .setContentText(resources.getQuantityString(R.plurals.new_updates_description_format, + .setContentText(resources.getQuantityString(R.plurals.new_updates_DESC_FORMAT, productItems.size, productItems.size)) .setColor(ContextThemeWrapper(this, R.style.Theme_Main_Light) .getColorFromAttr(android.R.attr.colorAccent).defaultColor) @@ -365,7 +365,7 @@ class SyncService: ConnectionService() { addLine(builder) } if (productItems.size > maxUpdates) { - val summary = getString(R.string.plus_more_format, productItems.size - maxUpdates) + val summary = getString(R.string.plus_more_FORMAT, productItems.size - maxUpdates) if (Android.sdk(24)) { addLine(summary) } else { diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml index 4d52ffa..2bdb8a3 100644 --- a/src/main/res/values/strings.xml +++ b/src/main/res/values/strings.xml @@ -5,162 +5,161 @@ Add repository Address All applications + All applications up to date Already exists Always - Has advertising - Compiled for debugging - Signed using an unsafe algorithm - Has security vulnerabilities - Source code no longer available - Promotes non-free applications or plugins - Contains non-free assets - Depends on non-free applications - Promotes non-free network services - Tracks or reports your activity - Upstream source code is not free Anti-features - Foxy Droid Application + Foxy Droid Application not found - Author website - Author email + Author email + Author website Available - No applications available Bug tracker Cancel - Cannot edit repository since it\'s syncing right now. + Cannot edit repository since it is syncing right now. Changelog + Changes Checking repository - Only compatible with %s - Confirmation + Compiled for debugging + Confirmation Connecting + Contains non-free media + Could not download %s + Could not sync %s + Could not validate %s Dark Date added Delete - Are you sure you want to delete the repository? + Are you sure you want to delete the repository? Description Details Donate + Downloaded %s Downloading - Downloading %s + Downloading %s Edit repository - No matching applications found - Could not download %s - Could not sync %s - Could not validate %s + Invalid file format. Fingerprint - Downloaded %s - Invalid server response. + Has advertising + Has non-free dependencies + Has security vulnerabilities + Invalid server response. HTTP proxy Ignore all updates Ignore this update - Missing features: - This version is older than the one installed on your device. + Your %1$s (API version %2$d) is not supported. %3$s + Maximum API version is %d. + Minimum API version is %d. + Missing features. + This version is older than the one installed on your device. Uninstall that first. - Your %1$s platform is not supported. + Your %1$s platform is not supported. Supported platforms: %2$s. - Your %1$s (SDK version %2$d) is not supported. %3$s - Maximum SDK version is %d. - Minimum SDK version is %d. - This version is signed with a different certificate than the one + This version is signed with a different certificate than the one installed on your device. Uninstall that first. Incompatible version Incompatible versions Show application versions incompatible with the device - Incompatible with %s + Incompatible with %s Install Installed - No applications installed + Could not check integrity. Invalid address Invalid fingerprint format + Invalid metadata. + Invalid permissions. + Invalid signature. Invalid username format Last update Launch License - License %s + License %s Light Link copied to clipboard Links - Merging %s + Merging %s Name - Network error. + Network error. Never New updates available - + %d new update. %d new updates. - No description available. + No applications available + No applications installed + No description available. + No matching applications found No proxy - This repository has not been used yet. You need to enable it to view - the applications it provides. + Notify about updates + Show a notification when updates are available Number of applications OK - Open %s? + Only compatible with %s + Only on Wi-Fi + Open %s? Other - Only on Wi-Fi - Could not parse the index file. + Could not parse the index file. Password - Password missing + Password missing Permissions - +%d more + +%d more Preferences - Processing %1$s + Processing %1$s Project website - Provided by %s + Promotes non-free network services + Promotes non-free software + Provided by %s Proxy Proxy host Proxy port Proxy type - Releases Repositories Repository - Requires %s + This repository has not been used yet. You need to enable it to view + the applications it provides. + Unsigned. Could not verify the application list. Be careful downloading + applications from unsigned repositories. + Requires %s Save Saving details Screenshots Search - Select a mirror + Select a mirror Show more - Show older releases + Show older versions + Signed using an unsafe algorithm Skip SOCKS proxy - Sorting order + Sorting order Source code + Source code no longer available Suggested Sync repositories Sync repositories automatically Syncing - Syncing %s - Tap to install. + Syncing %s + Tap to install. Theme + Tracks or reports your activity Uninstall Unknown - Unknown error. - Unknown: %s + Unknown error. + Unknown: %s Unsigned - Unsigned. Could not verify the application list. Be careful downloading - applications from unsigned repositories. Unstable updates Suggest installing unstable versions Unverified Update - Notify about updates - Show a notification when updates are available Updates - All applications up to date + Upstream source code is not free Username - Username missing - Index could not be validated. - Package could not be validated: %s. - invalid checksum - could not check integrity - invalid permissions - invalid signature - invalid file format - Version %s + Username missing + Index could not be validated. + Version %s + Versions Waiting to start download Website - What\'s new