From bcd6c33ed8aaa1cf81c027f88ce4a954e379a545 Mon Sep 17 00:00:00 2001 From: Jay Date: Sun, 12 Jan 2020 14:39:07 -0800 Subject: [PATCH] More Plurals --- .../data/backup/BackupRestoreService.kt | 3 ++- .../ui/migration/MigrationMangaDialog.kt | 2 +- .../manga/process/MigrationListController.kt | 11 ++++------- app/src/main/res/values/strings.xml | 16 ++++++++++------ 4 files changed, 17 insertions(+), 15 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupRestoreService.kt b/app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupRestoreService.kt index 2256a18d17..c82e4f2ee9 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupRestoreService.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupRestoreService.kt @@ -383,7 +383,8 @@ class BackupRestoreService : Service() { content.add(resources.getQuantityString(R.plurals.sources_missing, sourceMissingCount, sourceMissingCount)) if (lincensedManga > 0) - content.add(getString(R.string.x_licensed_manga, lincensedManga)) + content.add(resources.getQuantityString(R.plurals.licensed_manga, lincensedManga, + lincensedManga)) val trackingErrors = trackingErrors.distinct() if (trackingErrors.isNotEmpty()) { val trackingErrorsString = trackingErrors.distinct().joinToString("\n") diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/MigrationMangaDialog.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/MigrationMangaDialog.kt index 671a8442c1..fd2e6093a2 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/MigrationMangaDialog.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/MigrationMangaDialog.kt @@ -29,7 +29,7 @@ class MigrationMangaDialog(bundle: Bundle? = null) : DialogController(bundle) else "")) ?: "" return MaterialDialog(activity!!).show { message(text = confirmString) - positiveButton(android.R.string.yes) { + positiveButton(if (copy) R.string.copy else R.string.migrate) { if (copy) (targetController as? MigrationListController)?.copyMangas() else (targetController as? MigrationListController)?.migrateMangas() } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/manga/process/MigrationListController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/manga/process/MigrationListController.kt index 4293dc39a8..3753bddb6a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/manga/process/MigrationListController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/manga/process/MigrationListController.kt @@ -274,11 +274,8 @@ class MigrationListController(bundle: Bundle? = null) : BaseController(bundle), val res = resources if (res != null) { activity?.toast( - res.getString( - R.string.x_migrations, - if (manaulMigrations == 0) res.getString(R.string.no) - else "$manaulMigrations" - ) + res.getQuantityString(R.plurals.manga_migrated, + manaulMigrations, manaulMigrations) ) } router.popCurrentController() @@ -373,11 +370,11 @@ class MigrationListController(bundle: Bundle? = null) : BaseController(bundle), activity?.let { MaterialDialog(it).show { title(R.string.stop_migration) - positiveButton (R.string.yes) { + positiveButton (R.string.action_stop) { router.popCurrentController() migrationsJob?.cancel() } - negativeButton(R.string.no) + negativeButton(android.R.string.cancel) } } return true diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index ef5247a30f..3e32aba0c8 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -329,7 +329,10 @@ %d source missing %d sources missing - %1$d manga are now licensed and could not be restored + + %d manga is now licensed and could not be restored + %d manga are now licensed and could not be restored + Not logged into %1$s @@ -352,8 +355,8 @@ Refresh tracking metadata Updates status, score and last chapter read from the tracking services Clean up downloaded chapters - Deletes orphaned, tmp, and read chapter folders - for entire library for each Manga + Deletes non-existent, partially downloaded, + and read chapter folders Version @@ -460,9 +463,10 @@ Migrate %1$d%2$s manga? Copy %1$d%2$s manga? (skipping %1$d) - %1$s manga migrated - No - Yes + + %d manga migrated + %d manga migrated + No chapters found, this manga cannot be used for migration No Alternatives Found