From 7c014292d2b04cc6693dc8702a5951bbffcba833 Mon Sep 17 00:00:00 2001 From: arkon Date: Sat, 25 Apr 2020 15:55:28 -0400 Subject: [PATCH] Localize some restore strings --- .../eu/kanade/tachiyomi/data/backup/BackupRestoreService.kt | 2 +- .../eu/kanade/tachiyomi/ui/setting/backup/BackupNotifier.kt | 4 ++-- app/src/main/res/values/strings.xml | 3 ++- 3 files changed, 5 insertions(+), 4 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 3f5625877..6e3406beb 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 @@ -224,7 +224,7 @@ class BackupRestoreService : Service() { json.get(CATEGORIES)?.let { backupManager.restoreCategories(it.asJsonArray) restoreProgress += 1 - showRestoreProgress(restoreProgress, restoreAmount, "Categories added") + showRestoreProgress(restoreProgress, restoreAmount, getString(R.string.categories)) } mangasJson diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/backup/BackupNotifier.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/backup/BackupNotifier.kt index 1016eed5d..4c8ee4f44 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/backup/BackupNotifier.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/backup/BackupNotifier.kt @@ -111,8 +111,8 @@ internal class BackupNotifier(private val context: Context) { } fun showRestoreComplete(time: Long, errorCount: Int, path: String?, file: String?) { - val timeString = String.format( - "%02d min, %02d sec", + val timeString = context.getString( + R.string.restore_duration, TimeUnit.MILLISECONDS.toMinutes(time), TimeUnit.MILLISECONDS.toSeconds(time) - TimeUnit.MINUTES.toSeconds( TimeUnit.MILLISECONDS.toMinutes(time) diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 78ba5768c..2b90e9360 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -319,7 +319,8 @@ Restoring backup\n%1$s source not found Backup created Restore completed - Restore took %1$s with %2$s errors + %02d min, %02d sec + Done in %1$s with %2$s errors Restore uses sources to fetch data, carrier costs may apply.\n\nMake sure you have installed all necessary extensions and are logged in to sources and tracking services before restoring. File saved at %1$s Backup is already in progress