Replace restore completion string with plurals

This commit is contained in:
arkon 2020-05-08 18:07:21 -04:00
parent 5b53b90495
commit fb97ac47bc
2 changed files with 5 additions and 2 deletions

View File

@ -137,7 +137,7 @@ internal class BackupNotifier(private val context: Context) {
with(completeNotificationBuilder) { with(completeNotificationBuilder) {
setContentTitle(context.getString(R.string.restore_completed)) setContentTitle(context.getString(R.string.restore_completed))
setContentText(context.getString(R.string.restore_completed_content, timeString, errorCount)) setContentText(context.resources.getQuantityString(R.plurals.restore_completed_message, errorCount, timeString, errorCount))
// Clear old actions if they exist // Clear old actions if they exist
if (mActions.isNotEmpty()) { if (mActions.isNotEmpty()) {

View File

@ -326,7 +326,10 @@
<string name="backup_created">Backup created</string> <string name="backup_created">Backup created</string>
<string name="restore_completed">Restore completed</string> <string name="restore_completed">Restore completed</string>
<string name="restore_duration">%02d min, %02d sec</string> <string name="restore_duration">%02d min, %02d sec</string>
<string name="restore_completed_content">Done in %1$s with %2$s errors</string> <plurals name="restore_completed_message">
<item quantity="one">Done in %1$s with %2$s error</item>
<item quantity="other">Done in %1$s with %2$s errors</item>
</plurals>
<string name="backup_restore_content">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.</string> <string name="backup_restore_content">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.</string>
<string name="backup_in_progress">Backup is already in progress</string> <string name="backup_in_progress">Backup is already in progress</string>
<string name="backup_choice">What do you want to backup?</string> <string name="backup_choice">What do you want to backup?</string>